diff --git a/src/main/java/game/loadNextQuestion.java b/src/main/java/game/loadNextQuestion.java index 60bca5e..6c69b67 100644 --- a/src/main/java/game/loadNextQuestion.java +++ b/src/main/java/game/loadNextQuestion.java @@ -7,6 +7,9 @@ import Gui.GameGui; public class loadNextQuestion implements ActionListener { + GameGui gameStatus = new GameGui(); + runGame StartGame = new runGame(); + @Override public void actionPerformed(ActionEvent e) { @@ -48,18 +51,15 @@ public class loadNextQuestion implements ActionListener { public void loadQuestions() { if (GameGui.questionNr != runGame.arrQuestions.length - 1) { - runGame StartGame = new runGame(); StartGame.run(GameGui.questionNr); } else { - GameGui gameWin = new GameGui (); - gameWin.createWinningPanel(); + gameStatus.createWinningPanel(); } } public void wrongAnswer() { - GameGui gameLose = new GameGui(); - gameLose.createLosingPanel(); - gameLose.createRestartButton(); + gameStatus.createLosingPanel(); + gameStatus.createRestartButton(); } }