Both client and server must have Java 1.7 or higher installed.
For server deployment, please ensure the portNumber variable in ServerMain.java in the Server package has been assigned to the correct port number. To run the server, run the file ServerMain.java Please note: there is no graphical interface for the server
For clients to connect to the server correctly, be sure the portNumber variable in Player.java in the Client package has been assigned to the correct port number. To connect to a specific server ensure serverIP in Player.java contains IP address of the server. To connect to a local server keep serverIP = "localhost"; To run the client, run the file Player.java
Please note: A server must have already been started before running the client. Otherwise you will get a 'Connect to Server' error when trying to enter a username.
- Run Player.java
- You will be met with a screen to enter a username; this will be used to identify yourself throughout the course of the game.
- Once a valid username is entered, you will now be able to see all active users (those not in a game already) and can request a game with them by selected their name on the list and pressing 'Play'.
- Players can then accept or decline invitations to play. Note there is a time limit on request
- Once a user has accepted you will be invited to place your ships, to change the orientation or the active ship to be placed, please click the corresponding buttons.
- After you have confirmed, you will have to wait for your opponent to confirm their ships.
- The game will start; you will have a time limit on how long you can spend deliberating on a move. You can also chat to your opponent using the chat in the middle of the screen. To place a move click on the square you would like to fire a missile at, if you hit a part of their ship, the square will turn red and you will have another go, else it will show as blue and you will have lost your turn.
- Once the game is finished you will return to the lobby. During the ship placement or during at any point during the game you can also return to the lobby pressing the 'home' button. Note that your opponent will win by default if you quit