cschaf / battleship-extreme

An Battleship adoption with special rules
4 stars 2 forks source link

Battleship-Extreme

This is a project for the semester "Programming 2" at the "Hochschule Bremen".

Contributors are:

What is Battleship?

Battleship (or Battleships) is a game for two players where you try to guess the location of five ships your opponent has hidden on a grid. Players take turns calling out a row and column, attempting to name a square containing enemy ships. Originally published as Broadsides by Milton Bradley in 1931, the game was eventually reprinted as Battleship.

Goal

The object of Battleship is to try and sink all of the other player's before they sink all of your ships. All of the other player's ships are somewhere on his/her board. You try and hit them by calling out the coordinates of one of the squares on the board. The other player also tries to hit your ships by calling out coordinates. Neither you nor the other player can see the other's board so you must try to guess where they are. Each board in the physical game has two grids: the lower (horizontal) section for the player's ships and the upper part (vertical during play) for recording the player's guesses.

What is so extreme in our game?

We added a few rules which will make the game more interesting and more difficult.

Known Rules

Our added or updated Rules

How to play

Local

Client GUI

  1. In the menu screen you have to click on "Local Game".
  2. In the settings screen you have to set the game settings and start the game by click on "OK".
  3. Now you can play.

Multiplayer

Server GUI

  1. In the server gui you have to start the server.
  2. On the top menu you can create a standard game by click on "Games" -> "Create standard game".
  3. In the client gui you have to click on "Multiplayer Game".
  4. Enter the ip-address and port of the server, choose a username and connect to the server by click on "Connect".
  5. Now you can join existing games or create a custom game. To join a game, select a game from the list and click "Join". To create your own game, click on "Create" and enter the game settings. After the game was created you can join it.
  6. The game will start when all players are connected.

Gameplay

test

  1. At the beginning of the game each player has to place his ships on the right board and confirm by click on "Done".
  2. When all ships are placed the players can shoot on each other.
  3. To take a shot you have to
    1. Select an enemy from the box called "Enemys".
    2. From the box called "Your Ships" select a ship which should take the shot.
    3. Change the orientation of your shot by click on the right mouse button or selecting it manually in the box called "Orientation".
    4. Choose a valid field on the left board and click on it.
  4. To save a local game click on "Game" in the top menu and then click "Save...".

Project-Structure

Packages

UML Class Diagram 1

Models

UML Class Diagram 2

Client

UML Class Diagram 3

Server

UML Class Diagram 4

Network

UML Class Diagram 5

Activity-Diagrams

Sending an object to the server

Sequenz-Diagram 1

A Multiplayer Game

Activity-Diagram 1