rdemoparty / stardust

2D sidescroller
2 stars 0 forks source link

When vsync is forced to off, the game plays terrible #2

Closed benishor closed 9 years ago

benishor commented 9 years ago

This is due to how main loop is implemented: currently update() and render() are coupled and get called once per frame. If the framerate is high (~2000 on my system), the player ship can barely move (as if ship movement is not really frame rate independent).

Suggested fix: decouple update() from render(), fix the physics timestep and pre-step it (run into the future) and then use frame time accumulator remainder to interpolate at render() between the previous state and current.