https://github.com/dankolesnikov/battleship
Battleship game with Java Swing
https://github.com/dankolesnikov/battleship
battleship battleship-game java object-oriented-programming swing-gui
Last synced: 4 months ago
JSON representation
Battleship game with Java Swing
- Host: GitHub
- URL: https://github.com/dankolesnikov/battleship
- Owner: dankolesnikov
- Created: 2017-10-23T03:43:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-20T18:00:16.000Z (over 7 years ago)
- Last Synced: 2024-12-14T07:30:18.506Z (4 months ago)
- Topics: battleship, battleship-game, java, object-oriented-programming, swing-gui
- Language: Java
- Homepage:
- Size: 370 KB
- Stars: 9
- Watchers: 1
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Battleship Game
> Battleship Game in Java with State, MVC design patterns.
# Description
The game involves two grids(self and attack) positioned in JFrame. Self grid displays player's ships set in the beginning of the game. Attack grid displays the cells that the player attacked(green for hit and white for miss). Players take turns by clicking on the "Next" button that switches screens. Upon sunking the ship or winning the match, player will be displayed with congratulations pop-up message. Because of state design pattern player cannot fire more than once per turn nor player can add ships after setting them up in the beginning of the game.* 5 Ships max per plays
* 3 cells max per ship
* Design patterns used: MVC, State
* GUI Framework: Swing## Usage
Terminal:
```sh
cd out/artifacts/Battleship_jar
java -jar Battleship.jar
```GUI:
Click on the executable JAR.
```sh
cd out/artifacts/Battleship_jar/Battleship.jar
```
## MetaDanil Kolesnikov – [email protected]
Distributed under the MIT license.