Skip to content

janaiscoding/battleship

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jana's Battleship Game

Project's Scope

My BattleShip Project Tests

  • The scope of this project was to build the Battleship game only throught Test Driven Development.
  • It was unusual at first to write the Unit Testing and then start writing the code to make it pass, but it was a really fun and enjoyable experience in the end!
  • I worked with Classes again for Ship/Player/Gameboard/AI constructors, and all the game checking logic happens inside of the Classes.
  • After finishing the App, I learned how to manipulate the DOM to creaate the User Interface.
  • Furthermore, I have implemented an instructions panel and a mobile version that toggles between the 2 boards. The current version is not entirely responsive, but you can play it in the desktop and mobile version.

Live Demo

Image preview of the app gif of how to play

  • See the full live preview here

Getting Started

Installing and running

git clone https://github.com/janaiscoding/battleship.git
cd battleship
npm install
npx webpack

Testing with jest

npm run test

Project Details & Description

  • Play the classic game of Battleship against the AI!
  • You can place your ships horizontally or vertically.
  • You can't place your ship if another ship is taking that entire space.
  • You can't interact with the computer board until you placed all your ships.
  • You can't see the computer board's cells until you use your attacks.
  • First to sink all the ships wins! You can play as many times as you want!
  • The hit icon used in this project is from Font Awesome Icons.
  • This project is part of The Odin Project's curriculum.

Built with

Technologies

  • Vanilla JS
  • CSS3
  • HTML5

Tools Used

  • Jest
  • Visual Studio Code
  • npm package manager
  • Webpack Module Bundler
  • Linux Terminal
  • Git and Github

Future plans for this project

  • Mobile Responsiveness (check)