This commit is contained in:
Lars Alteköster 2021-11-29 13:58:40 +01:00
commit d51c97c989

View File

@ -29,8 +29,9 @@ public class HappyBirdMain extends Application {
private Label acronymLabel = new Label("KÜRZEL");
private Label headline = new Label("HAPPY BIRD");
private Label soundLabel = new Label("SOUND");
private Label labels[] = {nameLabel, acronymLabel, soundLabel};
private Label currentScoreLabel = new Label("SCORE");
private Label highscoreLabel = new Label("HIGHSCORE");
private Label labels[] = {nameLabel, acronymLabel, soundLabel, currentScoreLabel, highscoreLabel};
private Label headlineLabels[] = {headline};
private Button startButton = new Button("START");
@ -295,26 +296,26 @@ public class HappyBirdMain extends Application {
startGameButton.setOnAction(event -> {
startGameButtonClick();
});
for(Button button : buttons) {
button.setVisible(false);
}
startGameButton.setVisible(true);
menuButton.setVisible(true);
startGameButton.setLayoutY(520);
for(TextField feld : inputFields) {
feld.setVisible(true);
}
for (Label label : labels ) {
label.setVisible(true);
}
highscoreLabel.setVisible(false);
currentScoreLabel.setVisible(false);
soundLabel.setVisible(false);
}
/***
* Hauptmenü wird ausgeblendet, Einstellungen folgen
*/
@ -366,6 +367,7 @@ public class HappyBirdMain extends Application {
* Startet Spiel nach Namenseingabe
*/
public void startGameButtonClick() {
nameLabel.setText("NAME: " + acronym.getText());
for(TextField feld : inputFields) {
feld.setVisible(false);
}
@ -380,6 +382,9 @@ public class HappyBirdMain extends Application {
pane.getChildren().add(birdView);
birdView.setLayoutY(325);
birdView.setLayoutX(50);
nameLabel.setLayoutX(10);
nameLabel.setLayoutY(10);
nameLabel.setVisible(true);
ImageView upperPipeView = new ImageView(upperPipe);
pane.getChildren().add(upperPipeView);
@ -390,5 +395,12 @@ public class HappyBirdMain extends Application {
pane.getChildren().add(lowerPipeView);
lowerPipeView.setLayoutX(400);
lowerPipeView.setLayoutY(430);
currentScoreLabel.setLayoutX(540);
currentScoreLabel.setLayoutY(10);
currentScoreLabel.setVisible(true);
highscoreLabel.setLayoutX(540);
highscoreLabel.setLayoutY(70);
highscoreLabel.setVisible(true);
}
}