/prj-03-battleship_game

prj-03-battleship_game created by GitHub Classroom

Primary LanguageJavaMIT LicenseMIT

BattleShip

A simple battleship game written in Java with a Graphical User Interface and optional online playing.

Description:

Two players get connected through open port over internet or locally hosted port, a board is generated x by y square where players are given a set number of ships of random length. Placement of ships in any part inside the given board of their choice. Once both sides are ready, whoever is lucky to get the direct shot is able to make another hit, if the player misses, the next turn is their opponent. A hit or misses on the opponent board will mark the square, making it unavailable to be hit again. With that, the game ended when one of the players no longer had any ship alive.

How to Run

From JAR file

  • The java version on your machine must be 14 or greater for this game to work.
  • Download the BattleShip.jar file from the releases tab.
  • Navigate to where the file is saved and double click it to run.
  • When the game menu is displayed, click "host game" to begin a game.
  • Then to join a game, you you must run another instance of the BattleShip game and select "join game".
  • If you are connecting from a different machine, you must allow java programs through your firewall.
  • The correct IP and port will have to be supplied to join the game.

From your IDE

  • Fire up your favorite ide and make sure you have java 14 installed on your machine.
  • If you are using Intellij, you will have to follow a few steps to get the code to compilesuccessfully.
  • From Intellij, hit File->Settings->Editor->GUI Designer.
  • Once this window is opened up, click the button that says generate GUI into java source code.
  • This will allow you to develop, test, and run the BattleShip program from your IDE.

Local Network Only

The game works with no issues when using it on a local network. More testing and development is to come with using the public internet to run the game.

Project Goals

Click Here

Weekly Tasks and Personas

Click Here

UMLs Diagram

Click Here