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 b2de8f6..65ce4c7 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 @@ -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); } }