diff options
author | Justin Worthe <justin.worthe@gmail.com> | 2014-08-24 10:22:26 +0200 |
---|---|---|
committer | Justin Worthe <justin.worthe@gmail.com> | 2014-08-24 10:22:26 +0200 |
commit | 717e98c4159e9abd2165c490241a7d7b2caf1626 (patch) | |
tree | 11f01813992f085e3933ef90323e4397323fe303 /game/prefabs | |
parent | 12b4b233c4ec6079eb4924203dcae47226442946 (diff) |
Added required state for poison pills
Diffstat (limited to 'game/prefabs')
-rw-r--r-- | game/prefabs/player.js | 3 | ||||
-rw-r--r-- | game/prefabs/poisonPill.js | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/game/prefabs/player.js b/game/prefabs/player.js index a4d1b57..fb63707 100644 --- a/game/prefabs/player.js +++ b/game/prefabs/player.js @@ -17,6 +17,9 @@ var Player = function(game, x, y, key, frame, soundKey) { this.isMyTurn = false; this.animIsMyTurn = true; + this.hasPoisonPill = true; + this.poisonPillActive = false; + this.scoreSound = game.sound.add(soundKey); diff --git a/game/prefabs/poisonPill.js b/game/prefabs/poisonPill.js new file mode 100644 index 0000000..408f77f --- /dev/null +++ b/game/prefabs/poisonPill.js @@ -0,0 +1,18 @@ +'use strict'; + +var PoisonPill = function(game, x, y, frame) { + Phaser.Sprite.call(this, game, x, y, 'poison-pill', frame); + this.scale = {x: 0.01, y: 0.01}; + this.anchor = {x: 0.5, y: 0.5}; + + this.score = 1; +}; + +PoisonPill.prototype = Object.create(Phaser.Sprite.prototype); +PoisonPill.prototype.constructor = PoisonPill; + +PoisonPill.prototype.getBounds = function() { + return new Phaser.Rectangle(this.x, this.y, 0.2, 0.2); +}; + +module.exports = PoisonPill; |