Compare commits

...

5 Commits

Author SHA1 Message Date
6712042c42 Highscore/Score-Labels und Kürzel im Spiel 2021-11-29 13:57:03 +01:00
3f7137b449 Nochmal Zusammenführung 2021-11-29 13:35:28 +01:00
0f64db5855 Zusammenführung Ergebnisse 2021-11-29 13:34:03 +01:00
75916d8876 Zusammenführung der Ergebnisse 2021-11-29 13:25:32 +01:00
e54e1948b4 Zusammenführung der Methoden 2021-11-29 13:24:11 +01:00
10 changed files with 18 additions and 6 deletions

View File

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