So, it's the end of my hiatus since I last posted. I got married, changed job, house, car - actually pretty much all my life.
I'm back to creating Flash games, which is always enjoyable. I'm currently building a multiplayer world and various games attached to it. At the moment I'm building a Dance Dance Revolution type game which initially sounds simple, and it would be, but for the fact the Flash Player frame rate is all over the place.
If you have a 24fps movie, each frame should fire every 41.166* ms - or they *should*. In reality the frame rate can vary +- 20ms, which means after a short while the animation drifts away from the audio quite considerably. This problem is caused by a number of factors, mainly CPU speed/load and platform. It's bad on PC but terrible on an Mac.
So the problem is how do you get your beat hits to be absolutely precise to the music? I've managed to solve this problem by creating a "deltaTime" variable which calculates the drift per frame. If you know how many milliseconds it should be and how much drift you have, you can convert that to pixels to move, based on frame rate.
The net effect is a bit weird. The beat hits are spot on with the music, but this comes at a price because as the instructions scroll down the screen, the distance the instruction icons move is different each frame. This results in a jerky scrolling motion.
I'm hoping FP10 has more accurate frame rates that would solve this problem.