diff options
Diffstat (limited to 'js-platformer/src/player.js')
| -rw-r--r-- | js-platformer/src/player.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/js-platformer/src/player.js b/js-platformer/src/player.js new file mode 100644 index 0000000..e3520a5 --- /dev/null +++ b/js-platformer/src/player.js @@ -0,0 +1,18 @@ +var Player = function() { + this.texture = PIXI.Texture.fromImage("res/player.png"); + this.sprite = new PIXI.Sprite(this.texture); + + Engine.instance.addGameObject(this); + this.initPosition(); + + this.update = function() { + //this.prototype.update.call(this); + } + + return this; +} + +Player.prototype = new GameObjectPrototype(); + +//create a player instance +Engine.player = new Player();
\ No newline at end of file |
