Skip to content

Commit

Permalink
feat: update listenters names
Browse files Browse the repository at this point in the history
  • Loading branch information
PancakePhilarmonych committed Nov 19, 2023
1 parent c8c0827 commit 77469b3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/modules/GameObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ export class GameObject {
this.sprite.zIndex = 1;

this.sprite
.on("pointerdown", this.onDragStart, this)
.on("pointermove", this.onDragMove, this)
.on("pointerup", this.onDragEnd, this)
.on("pointerdown", this.onPointedDown, this)
.on("pointermove", this.onPointerMove, this)
.on("pointerup", this.onPointedUp, this)
}

setPosition(x: number, y: number) {
Expand All @@ -57,7 +57,7 @@ export class GameObject {
this.sprite.y = y;
}

onDragStart() {
onPointedDown() {
this.sprite.parent.emit<any>('select', this);
this.pointerDownTime = Date.now();

Expand All @@ -67,14 +67,14 @@ export class GameObject {
}, 100);
}

onDragMove() {
onPointerMove() {
if (this.isDragging) {
this.isUnblocked = true;
this.sprite.zIndex = 2;
}
}

onDragEnd(event: PIXI.FederatedPointerEvent) {
onPointedUp(event: PIXI.FederatedPointerEvent) {
clearTimeout(this.ponterDownTimeOut);

this.isDragging = false;
Expand Down Expand Up @@ -107,7 +107,6 @@ export class GameObject {
}

setColor(color: Colors) {
console.log('setColor', color)
this.color = color;
this.sprite.texture = getSpriteByColor[color];
}
Expand Down

0 comments on commit 77469b3

Please sign in to comment.