summaryrefslogtreecommitdiff
path: root/game/prefabs/player.js
diff options
context:
space:
mode:
Diffstat (limited to 'game/prefabs/player.js')
-rw-r--r--game/prefabs/player.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/game/prefabs/player.js b/game/prefabs/player.js
index 40fce38..e33b109 100644
--- a/game/prefabs/player.js
+++ b/game/prefabs/player.js
@@ -12,8 +12,6 @@ var Player = function(game, x, y, key, frame, soundKey) {
this.scale = {x: 0.01, y: 0.01};
this.anchor = {x: 0.5, y: 0.5};
- this.game.physics.arcade.enableBody(this);
-
this.score = 0;
this.maxScore = 1;
this.isMyTurn = false;
@@ -49,8 +47,8 @@ Player.prototype.update = function() {
Player.prototype.move = function(newX, newY, callback, callbackContext) {
this.moving = true;
var tween = this.game.add.tween(this).to({x: newX, y: newY}, 500);
- tween.onComplete.add(this.finishMovement, this);
tween.onComplete.add(callback, callbackContext);
+ tween.onComplete.add(this.finishMovement, this);
tween.start();
};
@@ -63,4 +61,8 @@ Player.prototype.finishMovement = function() {
this.moving = false;
};
+Player.prototype.getBounds = function() {
+ return new Phaser.Rectangle(this.x, this.y, 0.2, 0.2);
+};
+
module.exports = Player;