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:
logsol 2016-10-01 19:12:52 +02:00
parent c068592915
commit 3a5af058ef
7 changed files with 36 additions and 26 deletions

View file

@ -10,8 +10,6 @@ function () {
this._shift;
this._isJumping;
this._walkingDirectionStatus = 0;
this.inBetweenRounds = false;
}
PlayerController.prototype.moveLeft = function () {
@ -46,20 +44,17 @@ function () {
if(options) this.player.lookAt(options.x, options.y);
}
PlayerController.prototype.setInBetweenRounds = function(inBetweenRounds) {
this.inBetweenRounds = !!inBetweenRounds;
};
PlayerController.prototype.isPlayerInputAllowed = function() {
return !this.inBetweenRounds;
};
PlayerController.prototype.update = function () {
if(this._walkingDirectionStatus != 0) {
this.player.move(this._walkingDirectionStatus);
}
}
// Default behaviour - may be needed later?
PlayerController.prototype.isPlayerInputAllowed = function() {
return true;
};
PlayerController.prototype.destroy = function() {
// extend if necessary
};