diff options
author | Justin Worthe <justin.worthe@gmail.com> | 2014-08-24 11:48:17 +0200 |
---|---|---|
committer | Justin Worthe <justin.worthe@gmail.com> | 2014-08-24 11:48:17 +0200 |
commit | 41c0981eedf6933daeada7ece55234c0da525996 (patch) | |
tree | 9714a7c720e7b54c24b79b9d35deda90aaa4a1fb /game/prefabs | |
parent | 717e98c4159e9abd2165c490241a7d7b2caf1626 (diff) |
Added dropping and eating of poison pills
Diffstat (limited to 'game/prefabs')
-rw-r--r-- | game/prefabs/player.js | 4 |
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() { |