From e74950e005d89fe2fd8453a78d84f26e4e93dada Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Sat, 23 Aug 2014 14:11:38 +0200 Subject: Removed relying on arcade physics for overlap detection, added player respawn --- game/prefabs/pill.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'game/prefabs/pill.js') diff --git a/game/prefabs/pill.js b/game/prefabs/pill.js index 29bf7a2..13054b0 100644 --- a/game/prefabs/pill.js +++ b/game/prefabs/pill.js @@ -4,12 +4,15 @@ var Pill = function(game, x, y, frame) { Phaser.Sprite.call(this, game, x, y, '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 = 1; }; Pill.prototype = Object.create(Phaser.Sprite.prototype); Pill.prototype.constructor = Pill; +Pill.prototype.getBounds = function() { + return new Phaser.Rectangle(this.x, this.y, 0.2, 0.2); +}; + module.exports = Pill; -- cgit v1.2.3