5 Gameplay - longle97/GameDesign GitHub Wiki
Core Gameplay Loop
The game cycles between to main actions:
- Select Grid
- Hit or miss
Game Flow
Set up
- Player selects where to place their ships on the grid
- Player confirms they have completed placement
Game
- The player takes the first turn
Player's Turn
- Player selects grid space to aim their weapon at
- If selected grid space contains part of a ship:
- The player has 'hit' the enemy's ship
- The part of the damaged ship that was hit is exposed
- The player is given a consecutive turn *If selected grid does not contain part of a ship:
- The player has 'missed' the enemy's ship
- The grid space changes to show that the player has already fired at it and missed
- The player's turn ends
Enemy's turn
- The enemy is played by the computer (ie. not a real player)
- Enemy selects grid space to aim their weapon at
- If selected grid space contains part of a ship:
- The enemy has 'hit' the player's ship
- The part of the damaged ship that was hit is exposed
- The enemy is given a consecutive turn *If selected grid does not contain part of a ship:
- The enemy has 'missed' the enemy's ship
- The grid space changes to show that the enemy has already fired at it and missed
- The enemy's turn ends
Win & Lose States
The game is ended when either the player of the enemy have destroyed all of their opponent's ships. This only happens when each grid space that contains part of a ship has been 'hit'.
Win State
The win state is triggered when the player has 'hit' each grid space that contains part of an enemy ship. The win screen is displayed, and the player is given the option to play again or return to the menu.
Lose State
The lose state is triggered when the enemy has 'hit' each grid space that contains part of the player's ships. The lose screen is displayed, and the player is given the option to play again or return to the menu.