Coder Social home page Coder Social logo

battleship's Introduction

Battleship

This is a Battleship game project from The Odin Project curriculum with the use of vanilla JavaScript.

Test-Driven Development was used in developing this game.

Drag and Drop: Screen Shot 2022-07-27 at 12 18 12 AM Attacks and Misses: Screen Shot 2022-07-27 at 1 06 54 AM Mobile View: Screen Shot 2022-07-27 at 1 04 55 AM

Demo

Built With

  • HTML
  • CSS
  • JavaScript
  • Jest
  • Webpack

Getting Started

To get this project up and running locally, follow the steps below:

  1. Clone repository: git clone https://github.com/DenzelGranadoz/battleship.git

  2. Change directory into the cloned repository: cd battleship

  3. Once you have cloned this project, you can install the required dependencies by using: npm install

  4. Distribution files can be produced using: npm run build

Features

  • Drag and Drop ship placement, Tiles around ship placed is marked as reserved and highlighted red, prevents ship placement.
  • How to play Popup menu containing guidelines with sliding animation.
  • Supports Mobile Devices.
  • A hit on the enemy ship is marked as a bullseye.
  • A missed attack on the enemy board is marked as a gray dot.
  • Sinking enemy fleet will show a pop-up winner message.

Usage

  • Pressing on the 'Draggable' ship will change its direction from horizontal to vertical or vice versa.
  • Ships can be Dragged and Dropped but Random ship placement is available with the Random Board Button.
  • Board can be cleared during placement with the Reset Board Button.
  • A Start Button will appear once the ships has been placed.
  • Game would start after Start button has been pressed.
  • A how to play button can be found on the upper right corner of the screen.
  • Pressing on a tile or coordinate will order an attack in that spot.
  • The tile with the cursor on is highlighted.

Improvements

Features that can be added or improved on.

  • Improved AI
  • Better UI Design
  • 2 player mode

battleship's People

Contributors

denzelgranadoz avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.