diff options
Diffstat (limited to 'game/entities/player.js')
-rw-r--r-- | game/entities/player.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/game/entities/player.js b/game/entities/player.js index c7f0b94..f8c7a8b 100644 --- a/game/entities/player.js +++ b/game/entities/player.js @@ -1,9 +1,11 @@ 'use strict'; -var Player = function(game, x, y, key, frame, soundKey) { +var EntityBase = require('../entities/entityBase'); + +var Player = function(game, x, y, key, soundKey) { var player = this; - Phaser.Sprite.call(this, game, x, y, key, frame); + EntityBase.call(this, game, x, y, key); this.animations.add('active', [0]); this.animations.add('waiting', [1]); this.animations.add('activePoison', [2]); @@ -47,7 +49,7 @@ var Player = function(game, x, y, key, frame, soundKey) { }; }; -Player.prototype = Object.create(Phaser.Sprite.prototype); +Player.prototype = Object.create(EntityBase.prototype); Player.prototype.constructor = Player; Player.prototype.update = function() { @@ -111,8 +113,4 @@ Player.prototype.finishMovement = function() { this.lastTween = null; }; -Player.prototype.getBounds = function() { - return new Phaser.Rectangle(this.x, this.y, 0.2, 0.2); -}; - module.exports = Player; |