See here for a how to create a game loop with requestAnimationFrame
The trick is to run requestAnimationFrame as many times as possible but to move things relative to the time between frames(the dt variable in that example).
Hope it helps
See here for a how to create a game loop with requestAnimationFrame
The trick is to run requestAnimationFrame as many times as possible but to move things relative to the time between frames(the dt variable in that example).
Hope it helps