Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Battleship

A project originally developed for a object oriented programming course teached by Ivan Mathias Filho at the Pontifical Catholic University of Rio de Janeiro, implemented in Java, with the help of the GUI widget toolkit, Swing. The entire project was developed with Eclipse, in 1024x768 resolution.

Developed by

David Jentjens

Frederico Lacis



Index




Installation

  • To run the game simply download the .jar executable by clicking here.

  • To run the game in debug mode or fork the project it is recommended to clone the repository in Eclipse.

In any of the cases you need to have a running installation of the Java SE Runtime Environment, available here.




Game Rules

Starting a new game

Upon opening the game, the players will be met with a menu, in which they are able to choose to play a new game, load a previously played game or exit back to the desktop. Upon starting a new game, the players are required to inform their names, so they can be identified further in the match.

Starting Menu

Positioning Phase

Upon starting a game, both players must choose where to position their ships. Each one must position all ships to advance to the next phase. Player 1 goes first, while Player 2 looks away. Then Player 2 places his/her ships, while Player 1 looks away. The rules for placing ships are the following:

  • The player cannot place ships outside the borders
  • The player cannot place ships directly adjacent or diagonally to other ships

Rotation and Validation

Attack Phase

In this phase, players take turns attacking each other. While one player attacks, the other looks away. For every turn, the player has 3 attacks available. If a player hits all the parts of a ship, it is considered sunk. Once a player sinks every ship of his adversary, he wins the game.

Attacking Phase



About

🚢 A Java Swing implementation of the popular board game Battleship.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Contributors

Languages