Closed jeremy-flusin closed 8 years ago
Main game loop w/ events, physics and rendering calls
use of RequestAnimationFrame and not interval
RequestAnimationFrame
interval
Typical mainLoop :
function mainLoop() { requestAnimationFrame(mainLoop); update(); collision(); draw(); }
Main game loop w/ events, physics and rendering calls