console.log, checkpoint and code cleanup

This commit is contained in:
logsol 2014-03-31 05:06:52 +02:00
parent 39f684315b
commit 55b56f9c12
4 changed files with 31 additions and 29 deletions

View file

@ -66,30 +66,6 @@ function (PhysicsEngine, TiledLevel, Player, Nc) {
this.loadLevel(this.level.uid);
};
GameController.prototype.destroy = function () {
for(var player in this.players) {
// this.players[player].destroy();
// FIXME:
// commented out for now, because players are in gameObjects array.
// try using a real gameobject for the health bar
}
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
};
for (var key in this.gameObjects) {
for (var i = 0; i < this.gameObjects[key].length; i++) {
var gameObject = this.gameObjects[key][i];
this.onGameObjectRemove(key, gameObject);
gameObject.destroy();
};
};
this.physicsEngine.destroy();
}
/*
GameController.prototype.userJoined = function (user) {
this.players[user.id] = this.createPlayer(user);
@ -116,5 +92,29 @@ function (PhysicsEngine, TiledLevel, Player, Nc) {
return player;
};
GameController.prototype.destroy = function () {
for(var player in this.players) {
// this.players[player].destroy();
// FIXME:
// commented out for now, because players are in gameObjects array.
// try using a real gameobject for the health bar
}
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
};
for (var key in this.gameObjects) {
for (var i = 0; i < this.gameObjects[key].length; i++) {
var gameObject = this.gameObjects[key][i];
this.onGameObjectRemove(key, gameObject);
gameObject.destroy();
};
};
this.physicsEngine.destroy();
}
return GameController;
});