Browse Source

Created new JLabel and method for highscore

master
Ozan-Can Ekinci 2 years ago
parent
commit
e2a0224e77
  1. 7
      src/main/java/Gui/GameGui.java
  2. 2
      src/main/java/Gui/GameGuiInterface.java
  3. 1
      src/main/java/game/loadNextQuestion.java

7
src/main/java/Gui/GameGui.java

@ -16,7 +16,7 @@ import game.loadNextQuestion;
public class GameGui implements GameGuiInterface { public class GameGui implements GameGuiInterface {
public static JPanel MainPanel, ButtonPanel, headingPanel, WinningPanel, LosingPanel; public static JPanel MainPanel, ButtonPanel, headingPanel, WinningPanel, LosingPanel;
public static JLabel Headline,QuestionLabel,WinningLabel, LosingLabel, ShowQuestionNr;
public static JLabel Headline,QuestionLabel,WinningLabel, LosingLabel, ShowQuestionNr, HighScoreLabel;
public static JButton AnswersBtn1,AnswersBtn2,AnswersBtn3,AnswersBtn4,RestartBtn,RestartBtn1,ClosingBtn; public static JButton AnswersBtn1,AnswersBtn2,AnswersBtn3,AnswersBtn4,RestartBtn,RestartBtn1,ClosingBtn;
public static int questionNr = 0; public static int questionNr = 0;
public static int counter = 1; public static int counter = 1;
@ -173,5 +173,10 @@ GridBagConstraints gbc;
MainPanel.add(ButtonPanel); MainPanel.add(ButtonPanel);
} }
@Override
public void highScore() {
HighScoreLabel = new JLabel("Hier steht der Highscore");
LosingPanel.add(HighScoreLabel);
}
} }

2
src/main/java/Gui/GameGuiInterface.java

@ -20,4 +20,6 @@ public interface GameGuiInterface {
void createShowQuestion(int questionNr); void createShowQuestion(int questionNr);
void highScore();
} }

1
src/main/java/game/loadNextQuestion.java

@ -60,6 +60,7 @@ public class loadNextQuestion implements ActionListener {
public void wrongAnswer() { public void wrongAnswer() {
gameStatus.createLosingPanel(); gameStatus.createLosingPanel();
gameStatus.highScore();
} }
} }
Loading…
Cancel
Save