fix game restart

This commit is contained in:
sparshg
2024-10-06 00:46:53 +05:30
committed by Sparsh Goenka
parent cd1a156d3e
commit 5fee374ac9
5 changed files with 54 additions and 35 deletions

View File

@@ -67,7 +67,7 @@
callback={(i, j) => gameState.attack(i, j)}
/>
{#if gameState.game_over}
{#if gameState.phase === 'gameover'}
<div
class="absolute inset-0 flex items-center justify-center bg-black bg-opacity-50 pointer-events-none"
>
@@ -78,11 +78,7 @@
</p>
<button
class="btn btn-primary mt-4 pointer-events-auto"
onclick={() => {
let room = gameState.room;
leaveRoom();
gameState.joinRoom(room);
}}
onclick={() => gameState.playAgain()}
>
Play Again
</button>