Use Delta Time Instead of Approximate Time Per Frame #18
Labels
asteroids
For issues related to the asteroids game.
enhancement
New feature or request
help wanted
Extra attention is needed
Currently the game uses approximate time per frame as a simple way to make it work at multiple frame rates.
A better practice is to use the actual time between frames, which is delta time (change in time).
I already implemented dt in the Game class, it's just not used.
I think this is what needs to be done:
At the moment if the game is running at a lower frame rate than it's supposed to, the change in time will be greater than the approximate predicted change in time defined in the constant APPROX_TIME_PER_FRAME. This should result in the ship going slower than it's supposed to.
The text was updated successfully, but these errors were encountered: