In the old days, when DOS was the first choice for game developers, noone really carred about making Games CPU-Speed indepentent. Depending on the CPU, the games were either too fast or too slow. But in most of modern games, movements of the objects on the screen are calculated CPU-Speed indepentently. An object's movement will be on a P4 1200 as fast as on a PII 350. However if you would run it on a 486 66, there wouldn't much to calculate as you get 1 FPS at maximum.
The basic formula to do this is as follows:
object_pos = object_pos + object_speed * frametime;
This is the basic formula to calculate a movement in the current frame. It's like in physics. object_pos is the object's position. It will by incremented by the object's speed times the frametime. The frametime is the time in ms that the CPU needs to render exactly one frame. Apply this formula to all the objects in your code that move, rotate or do anything else. The movement will then always need the same time, whatever speed the user's processor has.
After this rather theorectical part follows a little demonstration how you could implement it. It will be done under Windows with the timer class STimer from the code section.
This little example (which of course will NOT work if you compile it now) shows you how you could implement timing in games. If you know the basic formula above, you know everything. If you want to see an example in action, download the game Memory from the projects section that uses this method.
Question? Comments? M@il me or visit the message board. Happy Coding!