From b4783ab327f290c4e4441a26a2ec2edfdb721175 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 30 Jul 2015 23:19:36 +0300 Subject: Add js-platformer. --- js-platformer/src/player.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 js-platformer/src/player.js (limited to 'js-platformer/src/player.js') 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 -- cgit v1.3