Project for the Integration of Information Systems course
Battleship (also Battleships or Sea Battle) is a strategy type guessing game for two players.
It is played on ruled grids (paper or board) on which each player's fleet of ships (including battleships) are marked.
The locations of the fleets are concealed from the other player. Players alternate turns calling "shots" at the other player's ships,
and the objective of the game is to destroy the opposing player's fleet.
When the game starts the player is given an initial state of their ships:
- 2 sized: 4 pcs
- 3 sized: 3 pcs
- 4 sized: 2 pcs
- 5 sized: 1 pcs
They can ask for new positions via a call to the corresponding API endpoint.
- Create new user if it does not exist
- Find user by Id
- Get all users
- Change username
- Create room: other player can join for a multiplayer game or the owner can leave
- Get all rooms
- Start a single player game vs. a naive robot
- Start a multiplayer game vs. a real user
- Shoot at a specific field
- Get leaderboard
To run the app:
- Start the MySQL docker container from the IDE or from CLI.
mvn spring-boot:runin thebattleshipfolder.
To enter the MySQL container: docker exec -it database mysql -uroot -ppassword in the battleship folder.
mysql> use battleship;
mysql> select * from room; or mysql> select * from user;
For other possible commands click here.
To run the app in docker container:
- Create image:
docker build -f src/main/resources/docker/Dockerfile -t <image_name>:<tag> ./in thebattleshipfolder after amvn clean install. - Edit the
docker-compose.ymlfile, enter the image name and tag in the 25th line. docker-compose upin the\battleship\src\main\resources\dockerfolder.
Battleship
Docker for Windows
If Docker Engine does not start, try this.
MySQL in Docker
The repository for the frontend app can be found here.