Contains a two-player battleship game written in JavaScript. Players have the option to play against a computer opponent or another player.
HTML 26.81%JavaScript 64.30%CSS 8.89%
eecs-448-project-2's Introduction
Project 2: Battleship with AI opponents
Group 17 - EECS 448
This program contains a battlship game written in JavaScript. For best experience, run the game in the Safari browser. The game allows for a tradtional two player game or the option to play against an Easy, Medium, or Hard AI opponent.
Welcome to Battleship!
This game allows for players to choose whether they would like to play against a computer opponent or a friend. It then allows the player to choose the number of ships to play with (1-6), and asks the player(s) to place the ships. After all ships have been placed, players will take turns attacking their opponents ships. Attacks are sent by typing in the coordinate of the desired attack, if playing against the computer attacks are sent after player 1 sends their attacks. While playing the game, players will have the ability to view their own board as well as the ability to view the attacks that they have sent on the opponents board. Once a player or computer has sunk all of the other players ships, the game will end and the program stops running.
AI Requirements:
For the AI component there will be three levels of difficulty. All AI will place their ships randomly with a legal ship placement.
Easy: It just fires randomly every turn.
Medium: It fires randomly until it hits a ship then fires in orthogonally adjacent spaces to find other hits until a ship is sunk.
Hard: Cheater, cheater pumpkin eater! This mode knows where all your ships are and lands a hit every turn.
Custom Requirement:
In addition to the AI requirments added, the game now includes background music as well as noises indicating a hit, miss, and game over.
File Explainations:
Documentation: This folder contains the proper jsdoc documentation in HTML format, works cited, previous groups design paradigm, explaination of custom artifact, and time logging for the project
eecs448project1: This folder contains the files that make up the game - index.html, style.css, and script.js. It also contains a Music folder where the sounds can be accessed
Archive: This folder contains the previous groups (Group 6) documentation and artifacts
User Instructions:
To play the Battleship game you first need to download the zip file. Once the file has been downloaded, open the eecs448project1 folder from your downloads folder and open the index.html file. This will take you to a new browser window where the game will be played. Once the html file is opened, follow the instructions on the screen.