From 17ebd1e3857d47ad5fd94e40283ecd468dd83739 Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Wed, 24 Sep 2014 17:20:56 +0200 Subject: Moved common game entity code into parent class --- game/entities/poisonPill.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'game/entities/poisonPill.js') diff --git a/game/entities/poisonPill.js b/game/entities/poisonPill.js index 408f77f..08b2952 100644 --- a/game/entities/poisonPill.js +++ b/game/entities/poisonPill.js @@ -1,18 +1,12 @@ '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}; +var EntityBase = require('../entities/entityBase'); - this.score = 1; +var PoisonPill = function(game, x, y) { + EntityBase.call(this, game, x, y, 'poison-pill'); }; -PoisonPill.prototype = Object.create(Phaser.Sprite.prototype); +PoisonPill.prototype = Object.create(EntityBase.prototype); PoisonPill.prototype.constructor = PoisonPill; -PoisonPill.prototype.getBounds = function() { - return new Phaser.Rectangle(this.x, this.y, 0.2, 0.2); -}; - module.exports = PoisonPill; -- cgit v1.2.3