5 ms·
Using the delta between frames directly isn't quite right either, but it's better than writing framerate-dependent code. I think an even better way is to use an
by mfichman 9y ago
Using the delta between frames directly isn't quite right either, but it's better than writing framerate-dependent code. I think an even better way is to use an accumulator with a fixed time step, as described here: http://gafferongames.com/game-physics/fix-your-timestep/ http://gafferongames.com/game-physics/fix-your-timestep/
- 0xdada 9y agoExactly what I was going to link. It's a very useful article that I've had bookmarked for a while now.
- koonsolo 9y agoYes, that article is 100% correct. Shameless plug here: A long time ago I wrote an article on how to implement a proper game loop, http://www.koonsolo.com/news/dewitters-gameloop/ http://www.koonsolo.com/news/dewitters-gameloop/