Skip to content

Web based popular BattleShip game where you can play with an intuitive computer player.

Notifications You must be signed in to change notification settings

Zoneam/Battleship

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Description

Battleship (also known as Battleships or Sea Battle) is a strategy type guessing game for two players. It is played on ruled grids on which each player's fleet of warships are marked. The locations of the fleets are concealed from the other player. Ship sizes are 1, 2, 2, 3, 4, 5.

Technologies

This application uses JavaScript, JQuery, Bootstrap and Animista.

Table of Contents:

Installation:

To run locally:

  • Just open index.html and enjoy the game.

User stories:

  • As a user I want to open the page and be presented with 2 game boards.
  • As a user I want to generate random game boards with button clicks.
  • As a user I want to be able to choose my ships to be more horizontal or vertical.
  • As a user I want to click start the button and start the game.
  • As a user I want to click on the opponent's board and make the shot.
  • As a user I want to see the shot positions with different color cells.
  • As a user I want to see the opponent's damaged ship in yellow color.
  • As a user I want to see opponents destroyed ship in red color.
  • As a user I want to view statistics about the game (Ships killed, shot count).
  • As a user I want to click on the new game button at any given time to restart the game.
  • As a user I want to see winner when all opponents ships are destroyed.
  • As a user I want to see opponents (AI) hidden ship positions when I lose the game.

Usage:

  • On the page you can generate your battleships randomly and choose the orientation.
  • Click Start The Battle button and game will begin.
  • Click on the boart to make the first shot.
  • AI will play randomly until it finds a ship.
  • After damaging a ship AI will start hitting all possible (4 if available) directions to find ship orientation (vertical or horizontal).
  • After second successful hit AI will determine ship orientation and follow ship direction to destroy it.
  • After destroying ship it will start hitting randomly to find another ship.
  • After destroying opponents ships (total of 6) Game Over message will show up and winner will be announced.
  • You can reset the game by pressing New Game button.
  • Game is optimazed for desktop and mobile.

Screenshot Desktop

License:

License: MIT

Contributing:

Feel free to contact me to contribute to this project. My contact information is listed below.

Questions:

Contact me: