Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

133 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues LinkedIn


Logo

Battleship

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
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. Contact
  7. Acknowledgments

About The Project

Let's Play Battleship Screen Shot

(back to top)

Built With

  • Javascript
  • Jest

(back to top)

Getting Started

To get a local copy up and running, follow these steps.

Prerequisites

  • Node.js (recommended v22+)
  • npm

Installation

  1. Clone the repository
    git clone https://github.com/MK-DlR/battleship-project.git
    cd battleship-project
  2. Install dependencies
    npm install
  3. Start the application
    npm start
  4. Open the app at http://localhost:8080

Notes

  • Built with: JavaScript + Jest (DOM manipulation, no frameworks)
  • Testing: Jest with Babel for ES module support
  • Run tests with npm test

(back to top)

Usage

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.

How to Use the App

  1. Open the app at http://localhost:8080 or visit the live demo
  2. 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.
  3. Sink all of the opponent's ships to complete the game.
  4. Upon game over, select "New Round" to play another round with the same players or "New Game" to change modes and/or names.

(back to top)

Roadmap

  • 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).

(back to top)

Contributing

As this is a student project created for The Odin Project curriculum, it is currently not open for contributions.

(back to top)

Top contributors:

contrib.rocks image

Contact

Adrien Newman - @MK_DlR - adriennewman92@gmail.com

Project Link: Repository & Live Demo

(back to top)

Acknowledgements

(back to top)

Majima as a pirate dodging gold coins

About

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.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages