Fix bug where clicking new game on death screen didnt actually start new game
This commit is contained in:
@@ -44,7 +44,10 @@ export class DeathOverlay {
|
||||
padding: { x: 20, y: 10 }
|
||||
}).setOrigin(0.5).setInteractive({ useHandCursor: true });
|
||||
|
||||
restartBtn.on("pointerdown", () => this.scene.events.emit("restart-game"));
|
||||
restartBtn.on("pointerdown", () => {
|
||||
const gameScene = this.scene.scene.get("GameScene");
|
||||
gameScene.events.emit("restart-game");
|
||||
});
|
||||
this.container.add(restartBtn);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user