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.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/game/prefabs/player.js b/game/prefabs/player.js
index fb63707..e1cdc60 100644
--- a/game/prefabs/player.js
+++ b/game/prefabs/player.js
@@ -19,6 +19,7 @@ var Player = function(game, x, y, key, frame, soundKey) {
this.hasPoisonPill = true;
this.poisonPillActive = false;
+ this.lastTween = null;
this.scoreSound = game.sound.add(soundKey);
@@ -54,6 +55,8 @@ Player.prototype.move = function(newX, newY, callback, callbackContext) {
tween.onComplete.add(callback, callbackContext);
tween.onComplete.add(this.finishMovement, this);
+ this.lastTween = tween;
+
tween.start();
};
@@ -77,6 +80,7 @@ Player.prototype.teleport = function(newX, newY) {
Player.prototype.finishMovement = function() {
this.moving = false;
+ this.lastTween = null;
};
Player.prototype.getBounds = function() {