diff --git a/Happy_Bird/.gradle/checksums/checksums.lock b/Happy_Bird/.gradle/checksums/checksums.lock index d0aac76..33c2b88 100644 Binary files a/Happy_Bird/.gradle/checksums/checksums.lock and b/Happy_Bird/.gradle/checksums/checksums.lock differ diff --git a/Happy_Bird/.gradle/checksums/md5-checksums.bin b/Happy_Bird/.gradle/checksums/md5-checksums.bin index 95f9002..be976af 100644 Binary files a/Happy_Bird/.gradle/checksums/md5-checksums.bin and b/Happy_Bird/.gradle/checksums/md5-checksums.bin differ diff --git a/Happy_Bird/.gradle/checksums/sha1-checksums.bin b/Happy_Bird/.gradle/checksums/sha1-checksums.bin index 6289ade..4e9e001 100644 Binary files a/Happy_Bird/.gradle/checksums/sha1-checksums.bin and b/Happy_Bird/.gradle/checksums/sha1-checksums.bin differ diff --git a/Happy_Bird/build/resources/main/com/example/happy_bird/pics/Background.png b/Happy_Bird/build/resources/main/com/example/happy_bird/pics/Background0.png similarity index 100% rename from Happy_Bird/build/resources/main/com/example/happy_bird/pics/Background.png rename to Happy_Bird/build/resources/main/com/example/happy_bird/pics/Background0.png diff --git a/Happy_Bird/build/resources/main/com/example/happy_bird/pics/Background0button.png b/Happy_Bird/build/resources/main/com/example/happy_bird/pics/Background0button.png new file mode 100644 index 0000000..8d7c655 Binary files /dev/null and b/Happy_Bird/build/resources/main/com/example/happy_bird/pics/Background0button.png differ diff --git a/Happy_Bird/build/resources/main/com/example/happy_bird/pics/Background1.png b/Happy_Bird/build/resources/main/com/example/happy_bird/pics/Background1.png new file mode 100644 index 0000000..ed9fca1 Binary files /dev/null and b/Happy_Bird/build/resources/main/com/example/happy_bird/pics/Background1.png differ diff --git a/Happy_Bird/build/resources/main/com/example/happy_bird/pics/Background1button.png b/Happy_Bird/build/resources/main/com/example/happy_bird/pics/Background1button.png new file mode 100644 index 0000000..d64c32d Binary files /dev/null and b/Happy_Bird/build/resources/main/com/example/happy_bird/pics/Background1button.png 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 2c61986..7a7e0cb 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 @@ -50,10 +50,13 @@ public class HappyBirdMain extends Application { private final Button settingsButtonPause = new Button("EINSTELLUNGEN"); private final Button menuButtonPause = new Button("HAUPTMENÜ"); private final Button backButtonPause = new Button("ZURÜCK"); + private final Button background1 = new Button(); + private final Button background2 = new Button(); /*Buttons in Arrays speichern*/ private final Button[] buttons = {startButton, highscoresButton, settingsButton, startGameButton, menuButton, pauseButton, continueButton, settingsButtonPause, menuButtonPause, backButtonPause}; private final Button[] pauseButtons = {continueButton, settingsButtonPause, menuButtonPause, backButtonPause}; + private final Button[] backgroundButtons = {background1, background2}; /*Textfelder erstellen und zuweisen*/ private final TextField name = new TextField(); @@ -115,7 +118,7 @@ public class HappyBirdMain extends Application { menuScreenRunning = true; /*Bild für Hintergrund erstellen:*/ - Image image = new Image("file:src/main/resources/com/example/happy_bird/pics/Background.png"); + Image image = new Image("file:src/main/resources/com/example/happy_bird/pics/Background0.png"); /*Hintergrund erstellen:*/ BackgroundImage backgroundImage = new BackgroundImage( @@ -179,6 +182,13 @@ public class HappyBirdMain extends Application { /*settingsButtonPause unsichtbar*/ settingsButtonPause.setVisible(false); + /*Buttons für Hintergründe*/ + backgroundButtonsFormating(); + + /*Background-Buttons unsichtbar*/ + background1.setVisible(false); + background2.setVisible(false); + /*Textfelder formatieren:*/ textfieldsFormating(inputFields, pane); @@ -280,6 +290,53 @@ public class HappyBirdMain extends Application { } } + + public void backgroundButtonsFormating() { + + int xPosition = 150; + + for(int i=0; i { + /*Bild für Hintergrund erstellen:*/ + Image image = new Image("file:src/main/resources/com/example/happy_bird/pics/Background0.png"); + + /*Hintergrund erstellen:*/ + BackgroundImage backgroundImage = new BackgroundImage( + image, + BackgroundRepeat.NO_REPEAT, + BackgroundRepeat.NO_REPEAT, + BackgroundPosition.DEFAULT, + BackgroundSize.DEFAULT + ); + + /*Hintergrund zu Pane hinzufügen:*/ + Background background = new Background(backgroundImage); + pane.setBackground(background); + }); + + background2.setOnAction(event -> { + /*Bild für Hintergrund erstellen:*/ + Image image = new Image("file:src/main/resources/com/example/happy_bird/pics/Background1.png"); + + /*Hintergrund erstellen:*/ + BackgroundImage backgroundImage = new BackgroundImage( + image, + BackgroundRepeat.NO_REPEAT, + BackgroundRepeat.NO_REPEAT, + BackgroundPosition.DEFAULT, + BackgroundSize.DEFAULT + ); + + /*Hintergrund zu Pane hinzufügen:*/ + Background background = new Background(backgroundImage); + pane.setBackground(background); + }); } /*** @@ -529,7 +626,14 @@ public class HappyBirdMain extends Application { settingsButton.setVisible(true); menuButton.setVisible(false); startGameButton.setVisible(false); +<<<<<<< HEAD highscoreMenuLabel.setVisible(false); +======= + + background1.setVisible(false); + background2.setVisible(false); + +>>>>>>> 7f359cb01fb2872353dbcf5aa715e11820a54013 /*soundSlider ausblenden*/ soundSlider.setVisible(false); diff --git a/Happy_Bird/src/main/resources/com/example/happy_bird/pics/Background.png b/Happy_Bird/src/main/resources/com/example/happy_bird/pics/Background0.png similarity index 100% rename from Happy_Bird/src/main/resources/com/example/happy_bird/pics/Background.png rename to Happy_Bird/src/main/resources/com/example/happy_bird/pics/Background0.png diff --git a/Happy_Bird/src/main/resources/com/example/happy_bird/pics/Background0button.png b/Happy_Bird/src/main/resources/com/example/happy_bird/pics/Background0button.png new file mode 100644 index 0000000..8d7c655 Binary files /dev/null and b/Happy_Bird/src/main/resources/com/example/happy_bird/pics/Background0button.png differ diff --git a/Happy_Bird/src/main/resources/com/example/happy_bird/pics/Background1.png b/Happy_Bird/src/main/resources/com/example/happy_bird/pics/Background1.png new file mode 100644 index 0000000..ed9fca1 Binary files /dev/null and b/Happy_Bird/src/main/resources/com/example/happy_bird/pics/Background1.png differ diff --git a/Happy_Bird/src/main/resources/com/example/happy_bird/pics/Background1button.png b/Happy_Bird/src/main/resources/com/example/happy_bird/pics/Background1button.png new file mode 100644 index 0000000..d64c32d Binary files /dev/null and b/Happy_Bird/src/main/resources/com/example/happy_bird/pics/Background1button.png differ