blob: 43218b1077475621bbb4db309be1be7643851482 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
function GameObject(texture) {
this.updateTexture(texture);
this.initPosition();
this.active = true;
this.objectType = "gameobject";
}
GameObject.prototype.updateTexture = function(name) {
this.texture = PIXI.Texture.fromImage("res/" + name + ".png");
this.sprite = new PIXI.Sprite(this.texture);
}
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() {
}
|