Nochmal Zusammenführung

This commit is contained in:
Mats Pape 2021-11-29 13:35:28 +01:00
commit 3f7137b449

View File

@ -48,6 +48,13 @@ public class HappyBirdMain extends Application {
private Slider soundSlider = new Slider();
private Image bird = new Image("file:src/main/resources/com/example/happy_bird/pics/bird.png", 50, 35, false, false);
private Image upperPipe = new Image("file:src/main/resources/com/example/happy_bird/pics/PipeOben.png", 86, 300, false, false);
private Image lowerPipe = new Image("file:src/main/resources/com/example/happy_bird/pics/PipeUnten.png", 86, 300, false, false);
public static void main(String[] args) {
launch(args);
}
@ -71,6 +78,7 @@ public class HappyBirdMain extends Application {
);
/**Hintergrund zu Pane hinzufügen:*/
<<<<<<< HEAD
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);
@ -83,6 +91,8 @@ public class HappyBirdMain extends Application {
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);
=======
>>>>>>> 082839ae867a23cdf54af575f5daed906e6a0b6f
Background background = new Background(backgroundImage);
pane.setBackground(background);
@ -298,6 +308,7 @@ public class HappyBirdMain extends Application {
public void startButtonClick() {
headline.setText("START");
startGameButton.setOnAction(event -> {
<<<<<<< HEAD
for(TextField feld : inputFields) {
feld.setVisible(false);
}
@ -322,6 +333,9 @@ public class HappyBirdMain extends Application {
pane.getChildren().add(lowerPipeView);
lowerPipeView.setLayoutX(400);
lowerPipeView.setLayoutY(430);
=======
startGameButtonClick();
>>>>>>> 082839ae867a23cdf54af575f5daed906e6a0b6f
});
for(Button button : buttons) {
@ -389,4 +403,34 @@ public class HappyBirdMain extends Application {
label.setVisible(false);
}
}
/***
* Startet Spiel nach Namenseingabe
*/
public void startGameButtonClick() {
for(TextField feld : inputFields) {
feld.setVisible(false);
}
for (Label label : labels )
{
label.setVisible(false);
}
startGameButton.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);
}
}