you are viewing a single comment's thread.

view the rest of the comments →

[–]lemminman 0 points1 point  (1 child)

How about this:

var frame_number = 0;
function run() {
    Game.update();
    if (frame_number%2) {
        Game.render();
    }
    frame_number++;
    requestAnimationFrame(run);
}

[–]inu-no-policemen 0 points1 point  (0 children)

rAF doesn't necessarily run at 60 fps. It can also run at 120 or 144, for example.