diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2015-11-16 16:58:18 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2015-11-16 16:58:18 +0200 |
| commit | 13c5dc317abe0fb4458e703f2ab9397a7c24c859 (patch) | |
| tree | 1410e5e6d250cbcadc29a1b66a851473e15da8b6 /src/gameobject.js | |
Rengöring
Diffstat (limited to 'src/gameobject.js')
| -rw-r--r-- | src/gameobject.js | 20 |
1 files changed, 20 insertions, 0 deletions
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 |
