diff options
author | Justin Worthe <justin.worthe@gmail.com> | 2014-09-02 07:40:00 +0200 |
---|---|---|
committer | Justin Worthe <justin.worthe@gmail.com> | 2014-09-02 07:40:00 +0200 |
commit | b6b236332187b8e6dc4f1acccda15672e6ce4e1e (patch) | |
tree | b7a1e0795aab578fb8920bb5334e64350e7f4c83 | |
parent | 0afb9206527dfae6793e5e569bd9084018048844 (diff) |
Added restrictions on dropping a poison pill in the respawn zone
-rw-r--r-- | game/states/play.js | 4 | ||||
-rw-r--r-- | todo.md | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/game/states/play.js b/game/states/play.js index 37dabb4..845fa8f 100644 --- a/game/states/play.js +++ b/game/states/play.js @@ -29,7 +29,7 @@ Play.prototype = { this.checkForPlayerPillCollisions(); this.checkForPlayerPoisonPillCollisions(); - if (this.playerA.canBeEaten && this.playerB.canBeEayen && + if (this.playerA.canBeEaten && this.playerB.canBeEaten && Phaser.Rectangle.intersects(this.playerA.getBounds(), this.playerB.getBounds())) { this.playerPlayerCollision(this.playerA, this.playerB); } @@ -275,7 +275,7 @@ Play.prototype = { movePlayer: function(player, deltaX, deltaY) { var newX = player.x + deltaX; var newY = player.y + deltaY; - var placePoisonPill = player.hasPoisonPill && player.poisonPillActive; + var placePoisonPill = player.hasPoisonPill && player.poisonPillActive && (Math.abs(this.respawnX-player.x)>1.1 || Math.abs(this.respawnY-player.y)>1.1); //cannot move into walls, when it isn't your turn, or when you're already moving if (this.checkMap(newX, newY) || !player.isMyTurn || player.moving) { @@ -1,8 +1,6 @@ TODO ==== -* Add restrictions on movement into the center - 4. Cannot drop poison pill in the middle * Add tutorial / instructions page * Add reset / end game early mechanism * Regenerate fonts with new colours |