I\'m using webkitRequestAnimationFrame but I\'m having trouble using it inside of an object. If I pass the this keyword it will use window
webkitRequestAnimationFrame
this
window
you have not to use "this". Keep it simple.
var game = { canvas:null, context:null, init:function(){ // init canvas, context, etc }, update:function(){ //do something game.render(); requestAnimationFrame(game.update, game.canvas); }, };