diff options
author | Justin Worthe <justin.worthe@gmail.com> | 2014-08-23 14:11:38 +0200 |
---|---|---|
committer | Justin Worthe <justin.worthe@gmail.com> | 2014-08-23 14:11:38 +0200 |
commit | e74950e005d89fe2fd8453a78d84f26e4e93dada (patch) | |
tree | 008c166bc66b45a1459c740e9f1da59b8e38c8f3 /game/prefabs/bonusPill.js | |
parent | 8c0a371916effa25ac77dc8a3420b95bd8b7a173 (diff) |
Removed relying on arcade physics for overlap detection, added player respawn
Diffstat (limited to 'game/prefabs/bonusPill.js')
-rw-r--r-- | game/prefabs/bonusPill.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/game/prefabs/bonusPill.js b/game/prefabs/bonusPill.js index 1b7ae56..dd8dfce 100644 --- a/game/prefabs/bonusPill.js +++ b/game/prefabs/bonusPill.js @@ -4,12 +4,15 @@ var BonusPill = function(game, x, y, frame) { Phaser.Sprite.call(this, game, x, y, 'bonus-pill', frame); this.scale = {x: 0.01, y: 0.01}; this.anchor = {x: 0.5, y: 0.5}; - - this.game.physics.arcade.enableBody(this); + this.score = 10; }; BonusPill.prototype = Object.create(Phaser.Sprite.prototype); BonusPill.prototype.constructor = BonusPill; +BonusPill.prototype.getBounds = function() { + return new Phaser.Rectangle(this.x, this.y, 0.2, 0.2); +}; + module.exports = BonusPill; |