Skip to content

HiDeny/Battleship

Repository files navigation

BattleShip

Table of Contents

Screenshots

BattleShip BattleShip BattleShip

Description

This is a simple implementation of the classic Battleship game that you can play directly in your web browser.

Based on Project: Battleship from The Odin Project cubiculum.

Play around and let me know your opinions!

Getting Started

To play the game, you can either download the source code and host it locally or access the live demo online.

Live Demo

👉🏻 Live Demo !

Building and running on localhost

First install dependencies:

npm install

To create a production build:

npm run build-prod

To create a development build:

npm run build-dev

Running

node dist/bundle.js

Testing

To run unit tests:

npm test

Game Rules

The Battleship game is a two-player strategy game where each player takes turns to guess the coordinates of their opponent's ships on a grid. The goal is to sink all of the opponent's ships before they sink yours.

Ships

  • Aircraft Carrier (5 spaces)
  • Battleship (4 spaces)
  • Cruiser (3 spaces)
  • 2x Destroyer (2 spaces)
  • 2x Submarine (1 space)

Features

  • Realistic grid layout for the game board.
  • Interactive interface for placing ships and making guesses.
  • Visual representation of hits, misses, and sunk ships.
  • End-of-game notification and option to restart.

How to Play

  • Open the game in your web browser.
  • Select your name.
  • Organize your ships.
  • Take turns guessing the coordinates to locate and sink the opponent's ships.
  • The game continues until one player sinks all of the opponent's ships.
  • A winner is declared, and players have the option to restart the game.

Technologies Used

  • HTML5
  • CSS3
  • JavaScript (ES6+)
  • Webpack
  • Babel
  • Eslint
  • Favicons-webpack-plugin
  • Html-webpack-plugin
  • Normalize.css

Credits

Made with createapp.dev Special thanks to the following:

License

BattleShip is open-source software licensed under the MIT License. Feel free to use, modify, and distribute it as per the terms of the license.

About

The Odin Project: Battleship

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published