HTML and CSS Reference
In-Depth Information
window.requestAnimationFrame =
window[vendors[x]+'RequestAnimationFrame'];
window.cancelAnimationFrame =
window[vendors[x]+'CancelAnimationFrame'] ||
window[vendors[x]+'CancelRequestAnimationFrame'];
}
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function(callback, element) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function() {
callback(currTime + timeToCall);
}, timeToCall);
lastTime = currTime + timeToCall;
return id;
};
if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}());
var Game = new function() {
var boards = [];
// Game Initialization
this.initialize = function(canvasElementId,sprite_data,callback) {
var ctx = this.ctx = AppMobi.canvas.getContext("2d");
this.ctx.width = 320;
this.ctx.height = 480;
this.playerOffset = 10;
this.canvasMultiplier= 1;
this.mobile = true;
this.width = 320;
this.height = 480;
this.loop();
this.setBoard(4,new TouchControls());
SpriteSheet.load(sprite_data,callback);
};
this.keys = {};
this.setKeys = function(l,r,fire) {
Game.keys['left'] = l;
 
Search WWH ::




Custom Search