diff options
author | Justin Worthe <justin.worthe@gmail.com> | 2014-08-31 09:42:42 +0200 |
---|---|---|
committer | Justin Worthe <justin.worthe@gmail.com> | 2014-08-31 09:42:42 +0200 |
commit | 94892a4e24b5c7b9618d6d5ae3e676b11ae8896d (patch) | |
tree | b1d6148541c2bb2c1d38f3ea24485d57b00c9185 /game/states/play.js | |
parent | 200c0896bc0e03f1ea15654abf76bddcbbe80989 (diff) |
Added gamepad support for poison pills
Diffstat (limited to 'game/states/play.js')
-rw-r--r-- | game/states/play.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/game/states/play.js b/game/states/play.js index 15304d5..4d6080b 100644 --- a/game/states/play.js +++ b/game/states/play.js @@ -152,6 +152,12 @@ Play.prototype = { if (pad.isDown(Phaser.Gamepad.XBOX360_DPAD_DOWN) || pad.axis(Phaser.Gamepad.XBOX360_STICK_LEFT_Y) > 0.2) { this.movePlayer(player, 0, 1); } + + var poisonButton = pad.getButton(Phaser.Gamepad.XBOX360_A); + if (poisonButton.isDown && player.gamepadPoisonLastPressed < poisonButton.timeDown) { + player.gamepadPoisonLastPressed = poisonButton.timeDown; + this.togglePoisonPill(player); + } }, readLevelFile: function() { this.pills = this.game.add.group(); |