added optimizer scripts and some code style improvements

This commit is contained in:
logsol 2015-03-09 04:56:28 +01:00
parent 6b472dc134
commit 5f5fec5b10
16 changed files with 397 additions and 36 deletions

View file

@ -20,12 +20,6 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
"use strict";
if (!window.cancelAnimationFrame) {
window.cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}
function GameController (options) {
this.clientIsReady = false;
@ -277,6 +271,12 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
GameController.prototype.destroy = function() {
if (!window.cancelAnimationFrame) {
window.cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}
cancelAnimationFrame(this.animationRequestId);
Parent.prototype.destroy.call(this);