Browse Source

implemented highscore functionality

master
Ozan-Can Ekinci 2 years ago
parent
commit
89351dd776
  1. 6
      src/main/java/Gui/GameGui.java

6
src/main/java/Gui/GameGui.java

@ -20,6 +20,7 @@ public static JLabel Headline,QuestionLabel,WinningLabel, LosingLabel, ShowQuest
public static JButton AnswersBtn1,AnswersBtn2,AnswersBtn3,AnswersBtn4,RestartBtn,RestartBtn1,ClosingBtn;
public static int questionNr = 0;
public static int counter = 1;
public static int highScore = 0;
GridLayout grid;
GridBagConstraints gbc;
@ -175,7 +176,10 @@ GridBagConstraints gbc;
@Override
public void highScore() {
HighScoreLabel = new JLabel("Hier steht der Highscore");
if (highScore < questionNr) {
highScore = questionNr;
}
HighScoreLabel = new JLabel("Dein Highscore ist: Frage " + highScore);
LosingPanel.add(HighScoreLabel);
}

Loading…
Cancel
Save