From 8d9e59e1d3addfcbeab2a00796e5e2da3ff0a608 Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Wed, 27 Aug 2014 08:12:55 +0200 Subject: Added visual indication of player ready to place poison pill --- game/states/play.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'game/states/play.js') diff --git a/game/states/play.js b/game/states/play.js index ec0ddae..15304d5 100644 --- a/game/states/play.js +++ b/game/states/play.js @@ -262,6 +262,9 @@ Play.prototype = { var newX = player.x + deltaX; var newY = player.y + deltaY; var placePoisonPill = player.hasPoisonPill && player.poisonPillActive; + if (this.checkMap(newX, newY) || !player.isMyTurn || player.moving) { + return; + } var posionPillX = player.x; var posionPillY = player.y; @@ -269,9 +272,7 @@ Play.prototype = { player.hasPoisonPill = false; } - if (this.checkMap(newX, newY) || !player.isMyTurn || player.moving) { - return; - } + var intermediateX = newX; var teleportX = newX; -- cgit v1.2.3