From e2a0224e777c45a34241ef4cb2534ea4281c331c Mon Sep 17 00:00:00 2001 From: Ozan-Can Ekinci Date: Fri, 13 Jan 2023 18:05:17 +0100 Subject: [PATCH] Created new JLabel and method for highscore --- src/main/java/Gui/GameGui.java | 7 ++++++- src/main/java/Gui/GameGuiInterface.java | 2 ++ src/main/java/game/loadNextQuestion.java | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/Gui/GameGui.java b/src/main/java/Gui/GameGui.java index 251dfba..56cd8d8 100644 --- a/src/main/java/Gui/GameGui.java +++ b/src/main/java/Gui/GameGui.java @@ -16,7 +16,7 @@ import game.loadNextQuestion; public class GameGui implements GameGuiInterface { 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 int questionNr = 0; public static int counter = 1; @@ -173,5 +173,10 @@ GridBagConstraints gbc; MainPanel.add(ButtonPanel); } + @Override + public void highScore() { + HighScoreLabel = new JLabel("Hier steht der Highscore"); + LosingPanel.add(HighScoreLabel); + } } diff --git a/src/main/java/Gui/GameGuiInterface.java b/src/main/java/Gui/GameGuiInterface.java index 246ec83..684d24b 100644 --- a/src/main/java/Gui/GameGuiInterface.java +++ b/src/main/java/Gui/GameGuiInterface.java @@ -20,4 +20,6 @@ public interface GameGuiInterface { void createShowQuestion(int questionNr); + void highScore(); + } \ No newline at end of file diff --git a/src/main/java/game/loadNextQuestion.java b/src/main/java/game/loadNextQuestion.java index 83a8340..4dec11e 100644 --- a/src/main/java/game/loadNextQuestion.java +++ b/src/main/java/game/loadNextQuestion.java @@ -60,6 +60,7 @@ public class loadNextQuestion implements ActionListener { public void wrongAnswer() { gameStatus.createLosingPanel(); + gameStatus.highScore(); } }