diff options
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 |
