summaryrefslogtreecommitdiff
path: root/game/entities/bonusPill.js
diff options
context:
space:
mode:
authorJustin Worthe <justin.worthe@gmail.com>2014-09-24 17:20:56 +0200
committerJustin Worthe <justin.worthe@gmail.com>2014-09-24 17:20:56 +0200
commit17ebd1e3857d47ad5fd94e40283ecd468dd83739 (patch)
tree6e65cf51bc9411af4c2d77a274838cebd32df85c /game/entities/bonusPill.js
parent1eabe62fcf61001a10b1965da0cf3a4ae741a25b (diff)
Moved common game entity code into parent class
Diffstat (limited to 'game/entities/bonusPill.js')
-rw-r--r--game/entities/bonusPill.js14
1 files changed, 5 insertions, 9 deletions
diff --git a/game/entities/bonusPill.js b/game/entities/bonusPill.js
index dd8dfce..ee4d79b 100644
--- a/game/entities/bonusPill.js
+++ b/game/entities/bonusPill.js
@@ -1,18 +1,14 @@
'use strict';
-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};
+var EntityBase = require('../entities/entityBase');
+
+var BonusPill = function(game, x, y) {
+ EntityBase.call(this, game, x, y, 'bonus-pill');
this.score = 10;
};
-BonusPill.prototype = Object.create(Phaser.Sprite.prototype);
+BonusPill.prototype = Object.create(EntityBase.prototype);
BonusPill.prototype.constructor = BonusPill;
-BonusPill.prototype.getBounds = function() {
- return new Phaser.Rectangle(this.x, this.y, 0.2, 0.2);
-};
-
module.exports = BonusPill;