team-thirtyfour / js13kgame

Glitch or die trying
https://team-thirtyfour.github.io/js13kgame/
1 stars 1 forks source link

Game Loop #2

Closed jeremy-flusin closed 8 years ago

jeremy-flusin commented 8 years ago

Main game loop w/ events, physics and rendering calls

manland commented 8 years ago

use of RequestAnimationFrame and not interval

manland commented 8 years ago

Typical mainLoop :

function mainLoop() {
    requestAnimationFrame(mainLoop);
    update();
    collision();
    draw();
}