TDD-based naval themed Battleship game web app with PC vs CPU and local PC vs PC functionality, automatic attack logging, a score counter, and full playability on tablets.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
To get a local copy up and running, follow these steps.
- Node.js (recommended v22+)
- npm
- Clone the repository
git clone https://github.com/MK-DlR/battleship-project.git cd battleship-project - Install dependencies
npm install
- Start the application
npm start
- Open the app at
http://localhost:8080
- Built with: JavaScript + Jest (DOM manipulation, no frameworks)
- Testing: Jest with Babel for ES module support
- Run tests with
npm test
This is a Battleship-style game application where players can play against the computer or locally against another player, attempting to sink all of the opponent's ships first.
The application allows for randomized ship placement and hit/miss/ship sunk logging.
- Open the app at http://localhost:8080 or visit the live demo
- Play the game:
- PC vs CPU: Set your name (optional) and press "New Game", randomize and confirm your ship placement, then press "Start Game".
- Local PC vs PC: Set both player names and press "New Game", both players must randomize and confirm their ship placements, then press "Start Game".
- Player names can be left blank as long as each "Set Player" button is pressed and "Confirm" is selected for both.
- Sink all of the opponent's ships to complete the game.
- Upon game over, select "New Round" to play another round with the same players or "New Game" to change modes and/or names.
- Upgrade CSS
- Make tablet friendly
- Add battle log
- Bug: Various battle log issues
- Bug: Player 2 custom name not always displaying
- Let players custom place their ships
- Drag and drop ships onto board
- Different AI difficulty selections
See the open issues for a full list of proposed features (and known issues).
As this is a student project created for The Odin Project curriculum, it is currently not open for contributions.
Adrien Newman - @MK_DlR - adriennewman92@gmail.com
Project Link: Repository & Live Demo

