12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- class Object2D extends GameObject
- {
- constructor(name)
- {
- super(name);
- this.position = Vector2.ZERO();
- this.rotationDegrees = 0;
- this.scale = Vector2.ONE();
- }
- draw(delta, db)
- {
- db.push();
- db.translate(this.position.x, this.position.y);
- db.rotate(this.rotationDegrees);
- db.scale(this.scale.x, this.scale.y);
- this._draw(delta, db);
- for (let i = 0; i < this.children.length; i++)
- this.children[i].draw(delta, db);
- db.pop()
- }
- }
|