PM2 Team 02 Projekt 1 Racetrack
Go to file
Leonardo Brandenberger 6560de8708 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	src/main/java/ch/zhaw/pm2/racetrack/InvalidFileFormatException.java
2022-03-25 22:04:18 +01:00
follower Code Cleanup 2022-03-25 21:14:18 +01:00
gradle/wrapper Initial commit 2022-03-04 09:04:12 +01:00
moves code cleanup 2022-03-25 21:48:12 +01:00
src Merge remote-tracking branch 'origin/main' 2022-03-25 22:04:18 +01:00
tracks completed Method initphase 2022-03-10 16:30:33 +01:00
.editorconfig Initial commit 2022-03-04 09:04:12 +01:00
.gitattributes Initial commit 2022-03-04 09:04:12 +01:00
.gitignore Initial commit 2022-03-04 09:04:12 +01:00
Klassendiagramm.svg code cleanup 2022-03-25 21:48:12 +01:00
README.md added java docs 2022-03-25 21:48:40 +01:00
build.gradle Changed mainClass in build.gradle to Main 2022-03-20 13:44:54 +01:00
gradle.properties Initial commit 2022-03-04 09:04:12 +01:00
gradlew Initial commit 2022-03-04 09:04:12 +01:00
gradlew.bat Initial commit 2022-03-04 09:04:12 +01:00
settings.gradle Initial commit 2022-03-04 09:04:12 +01:00

README.md

#PM2 Team 02 Projekt 1 Racetrack Racetrack is a pen and paper game that dates back to the early 1960s in this version of the game, the game is digitalized and the math behind it is done automatically rather than calculated by hand and the winner gets informed automatically as well.

The aim of the game is to finish the race faster than your opponent or win by being the only survivor in case the other cars crash.

In order to not crash you have to keep in mind the acceleration and other player's car to get to the finish line safely.

Initialization:

The game can be initialized by the terminal command:

./gradlew run

You will then be prompted to select a track file from the selection by entering the corresponding number.

For each car that is taking part in the race a strategy has to be chosen there are the following options:

  • Do not move Strategy

This Strategy sets the car stationary, and it won't make any moves during the game staying at the startpoint indefinitely.

  • User Move Strategy

The player is prompted for each move to make a choice the different choices you are able to take are as following:

1=down-left
2=down
3=down-right
4=left
5=no acceleration
6=right
7=up-left
8=up
9=up-right
it is also possible to leave the game when it is your turn by entering 10

  • Move List Strategy

For this strategy a predefined list of moves have to be given, the list may contain all allowed moves like mentioned in User Move Strategy

To create your own Move List strategy it needs to be located in /racetrack/moves and be named as track_name-car-character_of_car.txt and be a txt file.

  • Path Follow Move Strategy

A list of points given in a txt file where on each lime a coordinate is placed like (X:24, Y:22) gets used to calculate a path which makes the car cross each point.

To create your own follow move strategy it needs to be located in /racetrack/moves and be named as track_name_points.txt and be a txt file.

  • Path Finder Strategy

The pathfinder Strategy Calculates a route itself and follows it direction fully automatically.

The shown Track can be interpreted as following:
'spaces' are part of the raceable track.
'#' is a Wall
'>,<,^,v' are finish line components
'X' is shown if a car crashes at its crash location.
And every other character represents a car.

To create your own track it needs to be located inside /racetrack/tracks and be a txt file.

Determining a winner

The winner gets determined automatically.
The car that first passes the finish line (doing a complete round) is given the win, if all car except one crash the surviving car will be crowned as the winner.
The game will inform you of this, and you will have the option to quit the game or play another match.

Branching Model

We choose a simple branching model where all starting features got a branch and where merged into the main branch, some branches who needed unfinished code to be completed where taken from the game branch but merged into the main at the end as well.
Since there was just one end product we abstained from using a development branch and merges where done straight into main branch.
Commits which contain only documentation and doesn't change any functionality are committed directly into the Main branch.

Class Diagramm

This Class Diagramm is additional to the Class Diagramm given in the Anleitung.pdf

Classdiagramm of this program