Fix bug where clicking new game on death screen didnt actually start new game

This commit is contained in:
Peter Stockings
2026-01-05 14:12:13 +11:00
parent f86daac9ac
commit d638d1a821

View File

@@ -44,7 +44,10 @@ export class DeathOverlay {
padding: { x: 20, y: 10 } padding: { x: 20, y: 10 }
}).setOrigin(0.5).setInteractive({ useHandCursor: true }); }).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); this.container.add(restartBtn);
} }