Skip to content

Instantly share code, notes, and snippets.

@jonbro
Created December 20, 2015 00:06
Show Gist options
  • Select an option

  • Save jonbro/8445504b3fc630c3d544 to your computer and use it in GitHub Desktop.

Select an option

Save jonbro/8445504b3fc630c3d544 to your computer and use it in GitHub Desktop.
requestAnimFrameSystem = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) {
return window.setTimeout(callback, Game.INTERVAL / 2);
};
requestAnimFrame = function(callback) {
return requestAnimFrameSystem(function() {
var e;
try {
return callback();
} catch (_error) {
e = _error;
return console.log(e);
}
});
};
var updateFrame = function(){
meter.tickStart();
try {
L.execute("drawFrame()")
} catch(e) {
EditorConsole.appendErrorWithLineLink(e.toString(), 0,0);
console.log(e);
}
meter.tick();
return requestAnimFrame(updateFrame);
}
requestAnimFrame(updateFrame)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment