diff --git a/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.bin b/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.bin index 3fa4d1b..ebc5fc1 100644 Binary files a/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.bin and b/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.bin differ diff --git a/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.lock b/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.lock index eefc693..464cbe7 100644 Binary files a/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.lock and b/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.lock differ diff --git a/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.bin b/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.bin index 6ff2767..e368a4e 100644 Binary files a/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.bin and b/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.bin differ diff --git a/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.lock b/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.lock index 5249cb4..becbcd9 100644 Binary files a/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.lock and b/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.lock differ diff --git a/Happy_Bird/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/Happy_Bird/.gradle/buildOutputCleanup/buildOutputCleanup.lock index dae35f2..019071e 100644 Binary files a/Happy_Bird/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/Happy_Bird/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/Happy_Bird/build/classes/java/main/com/example/happy_bird/HappyBirdMain.class b/Happy_Bird/build/classes/java/main/com/example/happy_bird/HappyBirdMain.class index bff5945..74f90e5 100644 Binary files a/Happy_Bird/build/classes/java/main/com/example/happy_bird/HappyBirdMain.class and b/Happy_Bird/build/classes/java/main/com/example/happy_bird/HappyBirdMain.class differ diff --git a/Happy_Bird/build/libs/Happy_Bird-1.0-SNAPSHOT.jar b/Happy_Bird/build/libs/Happy_Bird-1.0-SNAPSHOT.jar index 17ff46a..b0e9a30 100644 Binary files a/Happy_Bird/build/libs/Happy_Bird-1.0-SNAPSHOT.jar and b/Happy_Bird/build/libs/Happy_Bird-1.0-SNAPSHOT.jar differ diff --git a/Happy_Bird/build/tmp/compileJava/previous-compilation-data.bin b/Happy_Bird/build/tmp/compileJava/previous-compilation-data.bin index 249d1ed..2afab2f 100644 Binary files a/Happy_Bird/build/tmp/compileJava/previous-compilation-data.bin and b/Happy_Bird/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/Happy_Bird/src/main/java/com/example/happy_bird/HappyBirdMain.java b/Happy_Bird/src/main/java/com/example/happy_bird/HappyBirdMain.java index 37c3f73..eb7e5b3 100644 --- a/Happy_Bird/src/main/java/com/example/happy_bird/HappyBirdMain.java +++ b/Happy_Bird/src/main/java/com/example/happy_bird/HappyBirdMain.java @@ -25,6 +25,7 @@ public class HappyBirdMain extends Application { private int collectedPoints; private int playerhighscore; private boolean openEndScreen = false; + private boolean endScreenOpened = false; /* Formatierungsklasse */ private final FormatingClass formatingClass = new FormatingClass(); @@ -445,8 +446,9 @@ public class HappyBirdMain extends Application { for (Rectangle rectangle : pipesToRemove) { pipesArrayList.remove(rectangle); } - } else { + } else if (endScreenOpened == false) { generateEndScreen(); + endScreenOpened = true; } } }; @@ -895,9 +897,10 @@ public class HappyBirdMain extends Application { */ public String calculatePersonalHighscores() { String bestFiveHighscores = "PLAYER\t\tSCORE\n\n"; - String currentPlayer = acronymLabel.getText(); + String currentPlayer = acronym.getText(); int i = 0; String sql = "SELECT * FROM happybirddb WHERE kuerzel = '" + currentPlayer + "' ORDER BY punkte DESC LIMIT 5;"; + System.out.println(sql); try (ResultSet rs = datenbank.st.executeQuery(sql)) { while (rs.next()) { @@ -1035,6 +1038,11 @@ public class HappyBirdMain extends Application { */ private void restartGameButtonClick() { pane.getChildren().remove(endScreen); + pane.getChildren().remove(happyBird); + for (Rectangle pipe : pipesArrayList) { + pane.getChildren().remove(pipe); + } + collectedPoints = 0; startGameButtonClick(); } @@ -1044,6 +1052,7 @@ public class HappyBirdMain extends Application { */ private void personalHighscoresButtonClick() { /* alle Buttons ausblenden */ + System.out.println("Highscore-Button"); for(Button button : endscreenButtons) { button.setVisible(false); } @@ -1057,12 +1066,11 @@ public class HappyBirdMain extends Application { currentScoreEndscreenLabel.setVisible(false); /* Highscore-Label (Hintergrund) formatieren und einfügen */ - highscoreMenuLabel.setLayoutX(275); - highscoreMenuLabel.setLayoutY(225); - highscoreMenuLabel.setPrefHeight(300); - highscoreMenuLabel.setPrefSize(250, 250); - highscoreMenuLabel.setVisible(true); + highscoreMenuLabel.setLayoutX(75); + highscoreMenuLabel.setLayoutY(150); + highscoreMenuLabel.setPrefSize(250, 300); endScreen.getChildren().add(highscoreMenuLabel); + highscoreMenuLabel.setVisible(true); /* Highscores des Spielers einfügen */ String personalBestScores = calculatePersonalHighscores(); @@ -1078,6 +1086,7 @@ public class HappyBirdMain extends Application { currentScoreEndscreenLabel.setVisible(true); highscoreMenuLabel.setVisible(false); backEndscreenButton.setVisible(false); + endScreen.getChildren().remove(highscoreMenuLabel); }); }