diff --git a/Happy_Bird/build/resources/main/com/example/happy_bird/pics/bird.png b/Happy_Bird/build/resources/main/com/example/happy_bird/pics/bird.png new file mode 100644 index 0000000..f05baa3 Binary files /dev/null and b/Happy_Bird/build/resources/main/com/example/happy_bird/pics/bird.png differ diff --git a/Happy_Bird/src/main/java/com/example/happy_bird/GameScreen.java b/Happy_Bird/src/main/java/com/example/happy_bird/GameScreen.java new file mode 100644 index 0000000..5bf395f --- /dev/null +++ b/Happy_Bird/src/main/java/com/example/happy_bird/GameScreen.java @@ -0,0 +1,25 @@ +package com.example.happy_bird; + +import javafx.application.Application; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.fxml.FXMLLoader; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.control.Slider; +import javafx.scene.image.*; +import javafx.scene.image.Image; +import javafx.scene.layout.*; +import javafx.scene.text.TextAlignment; +import javafx.stage.Stage; +import java.awt.*; +import java.io.IOException; + +public class GameScreen extends HappyBirdMain +{ + +} 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 7c78805..8f12286 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 @@ -63,7 +63,7 @@ public class HappyBirdMain extends Application { /**Hintergrund erstellen:*/ BackgroundImage backgroundImageImg = new BackgroundImage( - image, + backgroundImage, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, @@ -71,6 +71,18 @@ public class HappyBirdMain extends Application { ); /**Hintergrund zu Pane hinzufügen:*/ + Image bird = new Image("file:src/main/resources/com/example/happy_bird/pics/bird.png", 50, 35, false, false); + /*ImageView birdView = new ImageView(); + birdView.setFitHeight(50); + birdView.setFitWidth(50); + birdView.setLayoutX(50); + birdView.setLayoutY(325); + + */ + + Image upperPipe = new Image("file:src/main/resources/com/example/happy_bird/pics/PipeOben.png", 86, 300, false, false); + Image lowerPipe = new Image("file:src/main/resources/com/example/happy_bird/pics/PipeUnten.png", 86, 300, false, false); + Background background = new Background(backgroundImageImg); pane.setBackground(background); @@ -285,6 +297,32 @@ public class HappyBirdMain extends Application { */ public void startButtonClick() { headline.setText("START"); + startGame.setOnAction(event -> { + for(TextField feld : inputFields) { + feld.setVisible(false); + } + for (Label label : startLabels ) + { + label.setVisible(false); + } + startGame.setVisible(false); + menuButton.setVisible(false); + headline.setVisible(false); + ImageView birdView = new ImageView(bird); + pane.getChildren().add(birdView); + birdView.setLayoutY(325); + birdView.setLayoutX(50); + + ImageView upperPipeView = new ImageView(upperPipe); + pane.getChildren().add(upperPipeView); + upperPipeView.setLayoutX(400); + upperPipeView.setLayoutY(0); + + ImageView lowerPipeView = new ImageView(lowerPipe); + pane.getChildren().add(lowerPipeView); + lowerPipeView.setLayoutX(400); + lowerPipeView.setLayoutY(430); + }); for(Button button : buttons) { button.setVisible(false); diff --git a/Happy_Bird/src/main/resources/com/example/happy_bird/pics/bird.png b/Happy_Bird/src/main/resources/com/example/happy_bird/pics/bird.png new file mode 100644 index 0000000..f05baa3 Binary files /dev/null and b/Happy_Bird/src/main/resources/com/example/happy_bird/pics/bird.png differ