alexlima2023 / BATTLESHIPS_JS

"BATTLESHIPS: Engage in strategic battles on the high seas, deploying your fleet and outmaneuvering your opponent in this classic game of naval warfare."

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🚢 Battleship with HTML, CSS and JS ⚓

Description ⚠️

"In the game Battleship, you face off against the computer in a battle of naval strategy. You'll strategically position your fleet of ships on a grid, hidden from your opponent. Then, you take turns calling out coordinates to launch attacks on the computer's fleet, aiming to sink all of its ships before it sinks yours. The game requires keen deduction and tactical thinking to outsmart the computer and emerge as the victorious admiral."

Requirements 🛠️🖥️

  • Create port of War Table for Player and Computer.
  • Create Ships Area Table for Player and Computer.
  • Drag and drop effect for the positioning of the player's ships.
  • Player Attack Table.
  • Computer Attack Table.
  • Logic for positioning enemy ships.
  • Function to iterate over the table and find out if it is empty.
  • Function that generates a number from 0 to 99.
  • Implement difficulty levels: easy, medium, and hard.
  • Allow ships to be positioned in vertical, horizontal and diagonal positions.
  • Player Attack Function.
  • Enemy Attack Function
  • Attack effect in the enemy area and in the player's area.
  • Create Player Win Rule.
  • Create Enemy Win Rule
  • Function to read the positions of the player's ships and check if all ships are affixed.
  • Add sounds to the game.
  • Correcting shots in the water and on ships with Position Relative and Absolute.
  • Make sure the computer doesn't attack the same position.
  • Make sure the player doesn't attack the same position.
  • Create Random Ship Position Generation (Horizontal and Vertical).
  • Create Random Ship Position Generation (Diagonal).
  • Add Music and Sounds.
  • Add Music and Sounds.
  • Remove permission to drag ships after starting the game.
  • Create Game Reset System.
  • Better computer intelligence at the medium and hard level

Print 📸

V1

V2

About

"BATTLESHIPS: Engage in strategic battles on the high seas, deploying your fleet and outmaneuvering your opponent in this classic game of naval warfare."


Languages

Language:HTML 62.8%Language:JavaScript 30.0%Language:CSS 7.2%