+
{roomCode}
diff --git a/app/src/lib/state.svelte.ts b/app/src/lib/state.svelte.ts
index 6a3219f..ade04f3 100644
--- a/app/src/lib/state.svelte.ts
+++ b/app/src/lib/state.svelte.ts
@@ -25,7 +25,7 @@ export class State {
callback(this.playerBoard.board);
});
this.socket.on('turnover', (id) => {
- this.turn = id != this.socket.id;
+ this.turn = id == this.socket.id;
this.phase = this.turn ? 'selfturn' : 'otherturn';
});
this.socket.on('attacked', ({ by, at, hit, sunk }) => {
diff --git a/app/src/routes/+page.svelte b/app/src/routes/+page.svelte
index 1b2a1e9..8934f81 100644
--- a/app/src/routes/+page.svelte
+++ b/app/src/routes/+page.svelte
@@ -16,7 +16,11 @@
- {gameState.hasNotStarted() ? 'Place your ships' : 'Battle Phase'}
+ {gameState.hasNotStarted()
+ ? 'Place your ships'
+ : gameState.turn
+ ? 'Make a guess'
+ : 'Waiting for opponent'}
Your Ships: {5}
@@ -27,12 +31,21 @@
Your Board
- {}} />
+
+ {}}
+ />
Opponent's Board
- gameState.attack(i, j)} />
+ gameState.attack(i, j)}
+ />
{#if gameState.hasNotStarted()}