Skip to content

A classic Battleship game implemented in JavaScript. Players take turns guessing the locations of their opponent's ships on a grid until one player sinks all of the other's ships.

Notifications You must be signed in to change notification settings

TaichKarna/Battleship

Repository files navigation

Battleship Game

A classic Battleship game implemented in JavaScript. Players take turns guessing the locations of their opponent's ships on a grid until one player sinks all of the other's ships.

Features

  • Single Player Mode: Play against an AI opponent.
  • Grid System: Visual representation of the game board.
  • Hit and Miss Feedback: Visual indicators for hits and misses.

Tech Stack

  • Frontend: HTML, CSS, JavaScript
  • Game Logic: Vanilla JavaScript

Installation

  1. Clone the repository:

    git clone https://github.com/TaichKarna/Battleship.git 
  2. Navigate to the project directory:

    cd Battleship
    npm run start

How to Play

  1. Place your ships on the grid by dragging them to desired locations.
  2. Take turns guessing the coordinates of the opponent's ships.
  3. The game will indicate hits and misses.
  4. The first player to sink all opponent's ships wins!

Screenshots

Game Board

Game Board

Hit and Miss Indicators

Hit and Miss

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Push your branch (git push origin feature-branch).
  5. Create a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A classic Battleship game implemented in JavaScript. Players take turns guessing the locations of their opponent's ships on a grid until one player sinks all of the other's ships.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published