Skip to content

Commit

Permalink
Move station progress timer to front
Browse files Browse the repository at this point in the history
  • Loading branch information
Golen87 committed Aug 31, 2024
1 parent ef061a6 commit 3393f66
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/Station.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,12 @@ export class Station extends Button {

this.progressTimer = new Timer(
scene,
-0.4 * cellSize,
0.4 * cellSize,
x - 0.4 * cellSize,
y + 0.4 * cellSize,
0.8 * cellSize,
0xed51a4
);
this.progressTimer.setVisible(false);
this.add(this.progressTimer);

// Make station clickable during shopping
this.bindInteractive(this.sprite);
Expand All @@ -130,6 +129,7 @@ export class Station extends Button {
}

destroy(): void {
this.progressTimer.destroy();
this.upgradeIcon.destroy();
super.destroy();
}
Expand All @@ -148,6 +148,7 @@ export class Station extends Button {
}

setDepth(value: number): this {
this.progressTimer.setDepth(value + 50);
this.upgradeIcon.setDepth(value + 50);
return super.setDepth(value);
}
Expand Down

0 comments on commit 3393f66

Please sign in to comment.