Game #23

Merged
schrom01 merged 43 commits from Game into main 2022-03-20 16:56:34 +01:00
3 changed files with 5 additions and 3 deletions
Showing only changes of commit e5f45b7bb1 - Show all commits

View File

@ -187,6 +187,7 @@ public class Game implements GameSpecification {
if(winner != NO_WINNER) {
return winner;
}
switchToNextActiveCar();
} while (!allCarsCrashed());
return NO_WINNER;
}

View File

@ -7,10 +7,11 @@ public class Main {
public static void main(String[] args) throws InvalidTrackFormatException, FileNotFoundException, PositionVectorNotValid {
UserInterface userInterface = new UserInterface("Hello and Welcome");
Game game = new Game(userInterface);
int winner = 0;
if(game.initPhase()){
int winner = game.gamePhase();
winner = game.gamePhase();
}
userInterface.printInformation("Winner: " + winner);
}
}

View File

@ -52,7 +52,7 @@ public class UserInterface {
*/
public PositionVector.Direction selectDirection(int playingCarIndex, char playingCarID) {
PositionVector.Direction direction = null;
textTerminal.println("Playing Car " + playingCarIndex + ": " + playingCarIndex);
textTerminal.println("Playing Car " + playingCarIndex + ": " + playingCarID);
textTerminal.println("Directions are based on the number pad:");
textTerminal.println("7 8 9 7=up-left, 8=up, 9=up-right");
textTerminal.println("4 5 6 4=left, 5=no acceleration, 6=right");