diff options
Diffstat (limited to 'game')
-rw-r--r-- | game/prefabs/player.js | 4 | ||||
-rw-r--r-- | game/states/play.js | 2 |
2 files changed, 1 insertions, 5 deletions
diff --git a/game/prefabs/player.js b/game/prefabs/player.js index 3492836..98179d9 100644 --- a/game/prefabs/player.js +++ b/game/prefabs/player.js @@ -25,10 +25,6 @@ Player.prototype.update = function() { }; Player.prototype.move = function(newX, newY) { - if (this.moving || !this.isMyTurn) { - return; - } - this.moving = true; var tween = this.game.add.tween(this).to({x: newX, y: newY}, 500); tween.onComplete.add(this.finishMovement, this); diff --git a/game/states/play.js b/game/states/play.js index 104c322..e3009a5 100644 --- a/game/states/play.js +++ b/game/states/play.js @@ -182,7 +182,7 @@ Play.prototype = { var newX = player.x + deltaX; var newY = player.y + deltaY; - if (!this.checkMap(newX, newY) && player.isMyTurn) { + if (!this.checkMap(newX, newY) && player.isMyTurn && !player.moving) { player.move(newX, newY); this.togglePlayerTurn(); } |