added gangsta level and tried to fix on new level

This commit is contained in:
Jeena 2015-04-12 18:08:11 +02:00
parent 3283f97f07
commit 0592e2524d
11 changed files with 1434 additions and 15 deletions

View file

@ -86,13 +86,14 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) {
};
Networker.prototype.onLevelLoaded = function() {
/*
this.gameController.createMe(this.users[this.meUserId]);
for (var userId in this.users) {
if(this.meUserId != userId) {
this.gameController.createPlayer(this.users[userId]);
}
}
}*/
this.gameController.onLevelLoaded();
@ -166,7 +167,11 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) {
}
Networker.prototype.onGameCommand = function(message) {
this.gameController.onGameCommand(message);
if (this.gameController) {
this.gameController.onGameCommand(message);
} else {
console.warn("Networker.onGameCommand: this.gameController is undefined", message);
}
}
Networker.prototype.onPong = function(timestamp) {
@ -183,6 +188,14 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) {
}
this.gameController = new GameController(options);
this.gameController.createMe(this.users[this.meUserId]);
for (var userId in this.users) {
if(this.meUserId != userId) {
this.gameController.createPlayer(this.users[userId]);
}
}
};
Networker.prototype.onEndRound = function() {