`), // which lands in the raw page HTML — visible with a plain "View Source", no // dev tools needed. While a game is still being played, the enemy's // unrevealed ship cells/coordinates must never be part of that payload. Once // the game is over (either fleet fully sunk) it's fine — and good UX — to // show the real board, so we only mask while both fleets are still alive. $gameInProgress = ($game['phase'] === 'playing') && (($game['enemy_ship_count'] ?? 0) > 0) && (($game['my_ship_count'] ?? 0) > 0); if ($gameInProgress) { $game['enemy_grid'] = maskEnemyGrid($game['enemy_grid']); $game['enemy_ships'] = maskEnemyShips($game['enemy_ships']); } // Define ship types and colors for UI $SHIP_TYPES = ['Carrier'=>5, 'Battleship'=>4, 'Cruiser'=>3, 'Submarine'=>3, 'Destroyer'=>2]; $SHIP_COLORS = [ 'Carrier' => '#4a90e2', 'Battleship' => '#e24a4a', 'Cruiser' => '#4ae2a2', 'Submarine' => '#e2d54a', 'Destroyer' => '#9b4ae2' ]; ?> Battle.in – Fleet Command

Command Center

🛠️ PLACEMENT PHASE

Your Fleet

Enemy Fleet

Place your fleet!
Select a ship below and click the grid to place it. Press R to rotate.
Direction:
💥
ENEMY CARRIER SUNK!