From b6b236332187b8e6dc4f1acccda15672e6ce4e1e Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Tue, 2 Sep 2014 07:40:00 +0200 Subject: Added restrictions on dropping a poison pill in the respawn zone --- game/states/play.js | 4 ++-- 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) { diff --git a/todo.md b/todo.md index 3c51b36..8a324b9 100644 --- a/todo.md +++ b/todo.md @@ -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 -- cgit v1.2.3