summaryrefslogtreecommitdiff
path: root/game/prefabs/player.js
diff options
context:
space:
mode:
authorJustin Worthe <justin.worthe@entelect.co.za>2014-05-22 07:50:56 +0200
committerJustin Worthe <justin.worthe@entelect.co.za>2014-05-23 14:13:47 +0200
commitf58ea140ae6d6f0038e429ee47319ad3c9a74de1 (patch)
tree774f3a2c5f2c0cee5437bfb555c6476d7af23e6e /game/prefabs/player.js
parent507541065c5e39e2259c5a1f300491f3e388c426 (diff)
Added turn mechanic to game
re #10
Diffstat (limited to 'game/prefabs/player.js')
-rw-r--r--game/prefabs/player.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/game/prefabs/player.js b/game/prefabs/player.js
index b520947..0f6cb18 100644
--- a/game/prefabs/player.js
+++ b/game/prefabs/player.js
@@ -10,6 +10,7 @@ var Player = function(game, x, y, key, frame) {
this.game.physics.arcade.enableBody(this);
this.score = 0;
+ this.isMyTurn = false;
};
Player.prototype = Object.create(Phaser.Sprite.prototype);
@@ -19,7 +20,7 @@ Player.prototype.update = function() {
};
Player.prototype.move = function(newX, newY) {
- if (this.moving) {
+ if (this.moving || !this.isMyTurn) {
return;
}