# Battleship

**Battleship** is a shared-screen naval duel for RCWeb. One browser becomes the war room: a single unified ocean chart divided into a sector for every captain. Each phone becomes a private bridge where that captain hides a fleet and calls the shots. During battle, the chart shows what the shells have found while unhit ships stay hidden.

![icon](pwa-512x512.png "Battleship Display Icon")

## Features

- One shared ocean chart with private fleet placement on each phone.
- One to six human captains, with optional AI opponents.
- Live aiming, hit-and-miss history and a turn timer.
- Extra shots for hits and victory for the last fleet afloat.

## The game

The display draws **one ocean**, not one board per player. Every captain owns a sector of that ocean and the whole chart shares a single coordinate system, so a shot called at `Q12` means the same square on the big screen and on every phone in the room.

Battleship supports **1 to 6 human captains**. A solo player gets an **AI captain** automatically, and AI captains can be added or removed from any phone to fill the room up to six fleets.

- **Two captains** fight a classic duel on **10x10** sectors with five ships: Carrier (5), Battleship (4), Cruiser (3), Submarine (3) and Destroyer (2).
- **Three to six captains** fight a free-for-all on **8x8** sectors with four ships: Battleship (4), Cruiser (3), Submarine (3) and Destroyer (2).

Play runs in three phases. In **placement** every captain hides a fleet at the same time on their own phone, and the chart shows only who is ready. In **battle** captains take turns: pick a rival fleet, tap a square, then fire. **A hit earns another shot**, a miss passes the guns to the next captain. When every ship in a sector is sunk that fleet is out, and the **last fleet afloat wins**.

A turn clock keeps the game moving. If a captain runs out of time a shot is fired for them, and a captain who drops off the network has their turn skipped until they return.

## How to play

Open `/battleship/` on the shared screen. Players scan the QR code to open `/battleship-c/` on their phones in the same room, and pick a captain name.

1. Any phone presses **Start battle**. With only one human captain an AI opponent joins automatically.
2. Every phone gets a randomly hidden fleet. Tap a ship, tap a square to move it, **Rotate** to turn it, **Shuffle** for a fresh layout, then press **Ready**.
3. On your turn, choose a rival fleet from the tabs, tap a square on their sector, and press **Fire**.

While you line up a shot the crosshair appears live on the shared screen, so the room can see where the guns are pointing before the shell lands. Your phone buzzes when your own waters are hit.

## Screenshots

![Live crosshair while the captain aims](screenshot01.png)

![Battle chart after several exchanged salvos](screenshot02.png)

![Later battle with additional hits and misses](screenshot03.png)
