summaryrefslogtreecommitdiffstats
path: root/js-platformer/src/gameobject.js
blob: c7e47b435ecd72ad4b2c6b6c29e05ca65fbb1ddc (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
25
26
27
28
var GameObjectPrototype = function() {
	this.texture = PIXI.Texture.fromImage("res/red.png");
	this.sprite = new PIXI.Sprite(this.texture);

	this.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;
	}

	return this;
}

var GameObject = function() {

	this.initPosition();
	Engine.instance.addGameObject(this);

	this.update = function() {

	}

	return this;
}

GameObject.prototype = new GameObjectPrototype();