mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Prevents adding damage after round has ended
Because it created double round endings, which led to crashes. Also moved inBetweenRound state from PlayerController to GameController.
This commit is contained in:
parent
c068592915
commit
3a5af058ef
7 changed files with 36 additions and 26 deletions
|
|
@ -111,8 +111,8 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert)
|
|||
delete this.players[userId];
|
||||
};
|
||||
|
||||
GameController.prototype.createPlayer = function(user) {
|
||||
var player = new Player(user.id, this.physicsEngine, user);
|
||||
GameController.prototype.createPlayer = function(user, revealedGameController) {
|
||||
var player = new Player(user.id, this.physicsEngine, user, revealedGameController);
|
||||
this.players[user.id] = player;
|
||||
return player;
|
||||
};
|
||||
|
|
@ -132,8 +132,6 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert)
|
|||
};
|
||||
|
||||
GameController.prototype.destroy = function () {
|
||||
var i = 0;
|
||||
|
||||
for(var player in this.players) {
|
||||
this.players[player].destroy();
|
||||
}
|
||||
|
|
@ -150,7 +148,6 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert)
|
|||
this.worldUpdateObjects = null;
|
||||
|
||||
Nc.off(this.ncTokens);
|
||||
|
||||
};
|
||||
|
||||
return GameController;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue