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 33bbe47..5a1881f 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 @@ -95,7 +95,7 @@ public class HappyBirdMain extends Application { private final Slider soundSliderPause = new Slider(); /*Bilder*/ - private final Image bird = new Image("file:src/main/resources/com/example/happy_bird/pics/bird.png", 50, 35, false, false); + private final Image bird = new Image("file:src/main/resources/com/example/happy_bird/pics/bird.png", 45, 30, false, false); private final Image pipeTop = new Image("file:src/main/resources/com/example/happy_bird/pics/PipeTop.png"); private final Image pipeBottom = new Image("file:src/main/resources/com/example/happy_bird/pics/PipeBottom.png"); @@ -111,16 +111,13 @@ public class HappyBirdMain extends Application { private TranslateTransition top; private TranslateTransition bottom; + private TranslateTransition birdTransition; private Timeline timeline; private final ArrayList transitions = new ArrayList();; public static void main(String[] args) { - - launch(args); - - } @Override @@ -143,7 +140,6 @@ public class HappyBirdMain extends Application { startGameButtonClick(); }); - stage.show(); } @@ -161,17 +157,18 @@ public class HappyBirdMain extends Application { Rectangle topPipe = new Rectangle(900, y, 91, 500); /* Pipe unten; spawnt auf der gleichen Höhe wie obere Pipe - * +400, da y-Koord die untere linke Ecke ist - * +250, der Abstand zwischen oberer Pipe und unterer Pipe */ + * +400 +250, für Abstand zwischen oberer Pipe und unterer Pipe */ Rectangle bottomPipe = new Rectangle(900, y + 400 + 250, 91, 500); /* oberer Pipe ein Hintergrundbild geben */ Image img = new Image("file:src/main/resources/com/example/happy_bird/pics/PipeTop.png"); topPipe.setFill(new ImagePattern(pipeTop)); + topPipe.setStyle("-fx-view-order: 1"); /* unterer Pipe ein Hintergrundbild geben */ img = new Image("file:src/main/resources/com/example/happy_bird/pics/PipeBottom.png"); bottomPipe.setFill(new ImagePattern(pipeBottom)); + bottomPipe.setStyle("-fx-view-order: 1"); /* neue Animationen über TranslateTransitions */ top = new TranslateTransition();