forked from digitsensitive/astar-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gameobject.ts
23 lines (19 loc) · 654 Bytes
/
gameobject.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
* @description Gameobject class
* @author Digitsensitive <[email protected]>
* @copyright 2019 - 2023 Digitsensitive
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
export class GameObject extends Phaser.GameObjects.Image {
constructor(params) {
super(params.scene, params.x, params.y, params.key);
this.initImage(params.realSize, params.tint, params.alpha);
this.scene.add.existing(this);
}
private initImage(realSize: number, tint: number, alpha: number): void {
this.setOrigin(0, 0);
this.setDisplaySize(realSize, realSize);
this.setTint(tint);
this.setAlpha(alpha);
}
}