diff --git a/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.bin b/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.bin index 307dee7..8795319 100644 Binary files a/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.bin and b/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.bin differ diff --git a/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.lock b/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.lock index a4a63f1..d43ec3b 100644 Binary files a/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.lock and b/Happy_Bird/.gradle/7.1.1/executionHistory/executionHistory.lock differ diff --git a/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.bin b/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.bin index 04eb98e..f22deff 100644 Binary files a/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.bin and b/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.bin differ diff --git a/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.lock b/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.lock index 94e24bd..703c3ca 100644 Binary files a/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.lock and b/Happy_Bird/.gradle/7.1.1/fileHashes/fileHashes.lock differ diff --git a/Happy_Bird/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/Happy_Bird/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 71a1a2a..6ca2a6a 100644 Binary files a/Happy_Bird/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/Happy_Bird/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/Happy_Bird/build/classes/java/main/com/example/happy_bird/HappyBirdMain.class b/Happy_Bird/build/classes/java/main/com/example/happy_bird/HappyBirdMain.class index 68e2b0c..78c4398 100644 Binary files a/Happy_Bird/build/classes/java/main/com/example/happy_bird/HappyBirdMain.class and b/Happy_Bird/build/classes/java/main/com/example/happy_bird/HappyBirdMain.class differ diff --git a/Happy_Bird/build/libs/Happy_Bird-1.0-SNAPSHOT.jar b/Happy_Bird/build/libs/Happy_Bird-1.0-SNAPSHOT.jar index 08c92f8..34e1eb0 100644 Binary files a/Happy_Bird/build/libs/Happy_Bird-1.0-SNAPSHOT.jar and b/Happy_Bird/build/libs/Happy_Bird-1.0-SNAPSHOT.jar differ diff --git a/Happy_Bird/build/resources/main/com/example/happy_bird/happyBird.fxml b/Happy_Bird/build/resources/main/com/example/happy_bird/happyBird.fxml index c022d51..69648e2 100644 --- a/Happy_Bird/build/resources/main/com/example/happy_bird/happyBird.fxml +++ b/Happy_Bird/build/resources/main/com/example/happy_bird/happyBird.fxml @@ -5,10 +5,4 @@ - - - - - - diff --git a/Happy_Bird/build/tmp/compileJava/previous-compilation-data.bin b/Happy_Bird/build/tmp/compileJava/previous-compilation-data.bin index 14519ba..64c74e5 100644 Binary files a/Happy_Bird/build/tmp/compileJava/previous-compilation-data.bin and b/Happy_Bird/build/tmp/compileJava/previous-compilation-data.bin differ 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 a5af2d6..9252031 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 @@ -1,12 +1,15 @@ 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.image.*; import javafx.scene.image.Image; import javafx.scene.layout.*; @@ -24,9 +27,9 @@ public class HappyBirdMain extends Application { @Override public void start(Stage stage) throws IOException { - Pane stackPane = new Pane(); + Pane pane = new Pane(); - Scene scene = new Scene(stackPane, 800, 700); + Scene scene = new Scene(pane, 800, 700); stage.setTitle("Happy Bird"); stage.setScene(scene); @@ -40,12 +43,12 @@ public class HappyBirdMain extends Application { ); Background background = new Background(backgroundImageImg); - stackPane.setBackground(background); + pane.setBackground(background); - Label label = new Label("Happy Bird"); - label.setPrefSize(300, 75); - label.setTextAlignment(TextAlignment.CENTER); - label.setStyle("-fx-background-color: #DED894; " + + Label headline = new Label("Happy Bird"); + headline.setPrefSize(300, 75); + headline.setTextAlignment(TextAlignment.CENTER); + headline.setStyle("-fx-background-color: #DED894; " + "-fx-text-fill: #000000; " + "-fx-font-size: 35px; " + "-fx-border-width: 5px;" + @@ -54,20 +57,21 @@ public class HappyBirdMain extends Application { "-fx-alignment: center;" + "-fx-background-radius: 20px;" + "-fx-border-radius: 15px;"); - label.setLayoutX(250); - label.setLayoutY(100); + headline.setLayoutX(250); + headline.setLayoutY(100); - stackPane.getChildren().addAll(label); + pane.getChildren().addAll(headline); Button startButton = new Button("START"); Button highscoresButton = new Button("HIGHSCORES"); - Button einstellungsButton = new Button("EINSTELLUNGEN"); + Button settingsButton = new Button("EINSTELLUNGEN"); + Button spielStarten = new Button("SPIEL STARTEN"); - Button buttons[] = {startButton, highscoresButton, einstellungsButton}; + Button buttons[] = {startButton, highscoresButton, settingsButton, spielStarten}; int yPosition = 225; for (Button button : buttons) { - stackPane.getChildren().add(button); + pane.getChildren().add(button); button.setPrefSize(200, 50); button.setLayoutX(300); button.setLayoutY(yPosition); @@ -83,6 +87,70 @@ public class HappyBirdMain extends Application { "-fx-background-radius: 20px;"); } + spielStarten.setVisible(false); + + startButton.setOnAction(event -> { + headline.setText("Start"); + for(Button button : buttons) { + button.setVisible(false); + + } + + Label nameLabel = new Label("Name:"); + Label acronymLabel = new Label("Kürzel:"); + + Label startLabels[] = {nameLabel, acronymLabel}; + + int yPositionStartLabels = 225; + for(Label label : startLabels) { + label.setPrefSize(250, 50); + label.setStyle("-fx-background-color: #DED894; " + + "-fx-text-fill: #000000; " + + "-fx-font-size: 20px; " + + "-fx-border-width: 5px;" + + "-fx-border-color: #543847;" + + "-fx-font-weight: bold;" + + "-fx-alignment: center;" + + "-fx-background-radius: 20px;" + + "-fx-border-radius: 15px;"); + + label.setLayoutX(275); + label.setLayoutY(yPositionStartLabels); + yPositionStartLabels += 150; + + pane.getChildren().add(label); + } + + TextField name = new TextField(); + TextField acronym = new TextField(); + + TextField inputFields[] = {name, acronym}; + + int yPositionInputFields = 290; + for(TextField feld : inputFields) { + feld.setPrefSize(250, 50); + feld.setStyle("-fx-font-size: 20px;" + + "-fx-font-weight: bold;"); + + feld.setLayoutX(275); + feld.setLayoutY(yPositionInputFields); + yPositionInputFields += 150; + + pane.getChildren().add(feld); + } + + spielStarten.setVisible(true); + + spielStarten.setLayoutY(520); + }); + + + startButton.setOnAction(event -> { + + + + }); + stage.show(); } } diff --git a/Happy_Bird/src/main/resources/com/example/happy_bird/happyBird.fxml b/Happy_Bird/src/main/resources/com/example/happy_bird/happyBird.fxml index c022d51..69648e2 100644 --- a/Happy_Bird/src/main/resources/com/example/happy_bird/happyBird.fxml +++ b/Happy_Bird/src/main/resources/com/example/happy_bird/happyBird.fxml @@ -5,10 +5,4 @@ - - - - - -