From 13c5dc317abe0fb4458e703f2ab9397a7c24c859 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Mon, 16 Nov 2015 16:58:18 +0200 Subject: Rengöring MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gameobject.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/gameobject.js (limited to 'src/gameobject.js') diff --git a/src/gameobject.js b/src/gameobject.js new file mode 100644 index 0000000..0b50553 --- /dev/null +++ b/src/gameobject.js @@ -0,0 +1,20 @@ +function GameObject(texture) { + this.texture = PIXI.Texture.fromImage("res/" + texture + ".png"); + this.sprite = new PIXI.Sprite(this.texture); + + this.initPosition(); + this.active = true; + this.objectType = "gameobject"; +} + +GameObject.prototype.initPosition = function() { + this.sprite.anchor.x = 0.5; + this.sprite.anchor.y = 0.5; + + this.sprite.position.x = Settings.STAGE_WIDTH * 0.5; + this.sprite.position.y = Settings.STAGE_HEIGHT * 0.5; +} + +GameObject.prototype.update = function() { + +} \ No newline at end of file -- cgit v1.3