Gameplay - glaizacano/battleship-game GitHub Wiki

Mechanics:

Set up

When ships (pieces) are added to the board, occupied squares are shown in red

battleship board setup

If a piece can be moved, it will turn green

battleship piece turning

Players turn

battleship players turn

Top

The text displays how many shots have been fired (turns).

Left

The coordinates with a TARGET indicates where the player wants to fire. GREEN coordinates mark where the player has fired and MISSED the enemy. BLACK coordinates mark where the player has fired and HIT the enemy.

Right

Ship represent the integrity of enemy ships. Light shade for untouched, Dark shade for hit, and S.O.S. for sunk.

enemy ship sunk

Rules

The player can target any square they have not yet fired upon. If a player hits an enemy target, the square will turn black, and the icon on the right side of the screen is updated to reflect which ship is hit. If all squares an enemy target occupies are hit, the ship is "sunk" and the icon on the right side of the screen is updated to reflect which ship is sunk. These same rules apply respectively for when the enemy fires. The game ends when all of a players ships have been sunk, and the player who sunk them wins.