Proper framerate-independent game loop

Started by
10 comments, last by Firestryke31 11 years, 8 months ago
Yes, that looks pretty close to most games core loops.

Have fun :)
Advertisement
Sorry, I forgot to mention that my sample was just pseudocode (and apparently I completely forgot to decrement the accumulated time in the loop).

One thing you might possibly consider is, in a separate "game state," stepping one step into the future, and passing the post-looping [font=courier new,courier,monospace]total_time / UPDATE_STEP[/font] to the renderer to interpolate between the current step and the "future" step, giving smoother animations.

This topic is closed to new replies.

Advertisement