An application that lets you play the Battleship board game versus a rudimentary AI.
The goal of creating this project for The Odin Project curriculum was to learn to make complex webpack applications that included testing for individual modules. This was my first attempt at integrating and using the Jest testing framework on a project.
The application starts by collecting a username for the player to assign as the name in gameBoard object that tracks the board state.
Once the game has started, the player is able to place down their ships on their board to the left.
A button at the top of the screen allows players to switch the orientation of their ship.
After the ships have been placed, the player can procede with clicking on the computer's side of the board to attempt to hit their ships. A red peg indicates a hit, while a white peg a miss. The computer will respond immediately with an attack on your board, which you can see indicated. This continues until the player or computer sink all their enemies ships.
After all ships have been sunk for either the player or computer, the opposing party declares victory. A modal pops up indicating who has won the game.