Compare commits
No commits in common. "090da1392b5659e6ed195c6de284ce95a299ae38" and "2897dfd341a10ab4cd6961192e660be4ec93df93" have entirely different histories.
090da1392b
...
2897dfd341
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,7 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<?import javafx.scene.control.TextField?>
|
|
||||||
<?import javafx.scene.control.Button?>
|
|
||||||
<?import javafx.scene.image.*?>
|
<?import javafx.scene.image.*?>
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
|
|
||||||
@ -9,7 +7,7 @@
|
|||||||
|
|
||||||
<ImageView>
|
<ImageView>
|
||||||
<image>
|
<image>
|
||||||
<Image url="@pics/Background.png"></Image>
|
<Image url="@pics/Background.png" />
|
||||||
</image>
|
</image>
|
||||||
</ImageView>
|
</ImageView>
|
||||||
|
|
||||||
|
Binary file not shown.
@ -1,15 +1,12 @@
|
|||||||
package com.example.happy_bird;
|
package com.example.happy_bird;
|
||||||
|
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
import javafx.event.ActionEvent;
|
|
||||||
import javafx.event.EventHandler;
|
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
import javafx.geometry.Pos;
|
import javafx.geometry.Pos;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.Slider;
|
|
||||||
import javafx.scene.image.*;
|
import javafx.scene.image.*;
|
||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
import javafx.scene.layout.*;
|
import javafx.scene.layout.*;
|
||||||
@ -27,13 +24,12 @@ public class HappyBirdMain extends Application {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(Stage stage) throws IOException {
|
public void start(Stage stage) throws IOException {
|
||||||
Pane pane = new Pane();
|
Pane stackPane = new Pane();
|
||||||
|
|
||||||
Scene scene = new Scene(pane, 800, 700);
|
Scene scene = new Scene(stackPane, 800, 700);
|
||||||
stage.setTitle("Happy Bird");
|
stage.setTitle("Happy Bird");
|
||||||
stage.setScene(scene);
|
stage.setScene(scene);
|
||||||
|
|
||||||
//Backgroundimage
|
|
||||||
Image image = new Image("file:src/main/resources/com/example/happy_bird/pics/Background.png");
|
Image image = new Image("file:src/main/resources/com/example/happy_bird/pics/Background.png");
|
||||||
BackgroundImage backgroundImageImg = new BackgroundImage(
|
BackgroundImage backgroundImageImg = new BackgroundImage(
|
||||||
image,
|
image,
|
||||||
@ -44,13 +40,12 @@ public class HappyBirdMain extends Application {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Background background = new Background(backgroundImageImg);
|
Background background = new Background(backgroundImageImg);
|
||||||
pane.setBackground(background);
|
stackPane.setBackground(background);
|
||||||
|
|
||||||
//Headline-Label
|
Label label = new Label("Happy Bird");
|
||||||
Label headline = new Label("Happy Bird");
|
label.setPrefSize(300, 75);
|
||||||
headline.setPrefSize(300, 75);
|
label.setTextAlignment(TextAlignment.CENTER);
|
||||||
headline.setTextAlignment(TextAlignment.CENTER);
|
label.setStyle("-fx-background-color: #DED894; " +
|
||||||
headline.setStyle("-fx-background-color: #DED894; " +
|
|
||||||
"-fx-text-fill: #000000; " +
|
"-fx-text-fill: #000000; " +
|
||||||
"-fx-font-size: 35px; " +
|
"-fx-font-size: 35px; " +
|
||||||
"-fx-border-width: 5px;" +
|
"-fx-border-width: 5px;" +
|
||||||
@ -59,35 +54,20 @@ public class HappyBirdMain extends Application {
|
|||||||
"-fx-alignment: center;" +
|
"-fx-alignment: center;" +
|
||||||
"-fx-background-radius: 20px;" +
|
"-fx-background-radius: 20px;" +
|
||||||
"-fx-border-radius: 15px;");
|
"-fx-border-radius: 15px;");
|
||||||
headline.setLayoutX(250);
|
label.setLayoutX(250);
|
||||||
headline.setLayoutY(100);
|
label.setLayoutY(100);
|
||||||
|
|
||||||
pane.getChildren().add(headline);
|
stackPane.getChildren().addAll(label);
|
||||||
|
|
||||||
//Buttons:
|
|
||||||
Button startButton = new Button("START");
|
Button startButton = new Button("START");
|
||||||
Button highscoresButton = new Button("HIGHSCORES");
|
Button highscoresButton = new Button("HIGHSCORES");
|
||||||
Button settingsButton = new Button("EINSTELLUNGEN");
|
Button einstellungsButton = new Button("EINSTELLUNGEN");
|
||||||
Button menuButton = new Button("ZURÜCK");
|
|
||||||
menuButton.setStyle("-fx-background-color: #e86000; " +
|
|
||||||
"-fx-text-fill: #FFFFFF; " +
|
|
||||||
"-fx-font-size: 20px; " +
|
|
||||||
"-fx-border-width: 5px;" +
|
|
||||||
"-fx-border-color: #FFFFFF;" +
|
|
||||||
"-fx-font-weight: bold;" +
|
|
||||||
"-fx-border-radius: 15px;" +
|
|
||||||
"-fx-background-radius: 20px;");
|
|
||||||
pane.getChildren().add(menuButton);
|
|
||||||
menuButton.setPrefSize(200, 50);
|
|
||||||
menuButton.setLayoutX(300);
|
|
||||||
menuButton.setLayoutY(425);
|
|
||||||
menuButton.setVisible(false);
|
|
||||||
|
|
||||||
Button buttons[] = {startButton, highscoresButton, settingsButton};
|
Button buttons[] = {startButton, highscoresButton, einstellungsButton};
|
||||||
|
|
||||||
int yPosition = 225;
|
int yPosition = 225;
|
||||||
for (Button button : buttons) {
|
for (Button button : buttons) {
|
||||||
pane.getChildren().add(button);
|
stackPane.getChildren().add(button);
|
||||||
button.setPrefSize(200, 50);
|
button.setPrefSize(200, 50);
|
||||||
button.setLayoutX(300);
|
button.setLayoutX(300);
|
||||||
button.setLayoutY(yPosition);
|
button.setLayoutY(yPosition);
|
||||||
@ -103,60 +83,6 @@ public class HappyBirdMain extends Application {
|
|||||||
"-fx-background-radius: 20px;");
|
"-fx-background-radius: 20px;");
|
||||||
}
|
}
|
||||||
|
|
||||||
//Slider:
|
|
||||||
Slider soundSlider = new Slider();
|
|
||||||
pane.getChildren().add(soundSlider);
|
|
||||||
soundSlider.setPrefSize(200, 5);
|
|
||||||
soundSlider.setLayoutX(300);
|
|
||||||
soundSlider.setLayoutY(295);
|
|
||||||
soundSlider.setVisible(false);
|
|
||||||
|
|
||||||
Label soundLabel = new Label("SOUND");
|
|
||||||
soundLabel.setPrefSize(200, 55);
|
|
||||||
soundLabel.setTextAlignment(TextAlignment.CENTER);
|
|
||||||
soundLabel.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;");
|
|
||||||
soundLabel.setLayoutX(300);
|
|
||||||
soundLabel.setLayoutY(225);
|
|
||||||
|
|
||||||
pane.getChildren().add(soundLabel);
|
|
||||||
soundLabel.setVisible(false);
|
|
||||||
|
|
||||||
settingsButton.setOnAction(event -> {
|
|
||||||
headline.setText("EINSTELLUNGEN");
|
|
||||||
startButton.setVisible(false);
|
|
||||||
highscoresButton.setVisible(false);
|
|
||||||
settingsButton.setVisible(false);
|
|
||||||
menuButton.setVisible(true);
|
|
||||||
soundSlider.setVisible(true);
|
|
||||||
soundLabel.setVisible(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
highscoresButton.setOnAction(event -> {
|
|
||||||
headline.setText("HIGHSCORES");
|
|
||||||
startButton.setVisible(false);
|
|
||||||
highscoresButton.setVisible(false);
|
|
||||||
settingsButton.setVisible(false);
|
|
||||||
menuButton.setVisible(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
menuButton.setOnAction(event -> {
|
|
||||||
headline.setText("HAPPY BIRD");
|
|
||||||
startButton.setVisible(true);
|
|
||||||
highscoresButton.setVisible(true);
|
|
||||||
settingsButton.setVisible(true);
|
|
||||||
menuButton.setVisible(false);
|
|
||||||
soundSlider.setVisible(false);
|
|
||||||
soundLabel.setVisible(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
stage.show();
|
stage.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<?import javafx.scene.control.TextField?>
|
|
||||||
<?import javafx.scene.control.Button?>
|
|
||||||
<?import javafx.scene.image.*?>
|
<?import javafx.scene.image.*?>
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
|
|
||||||
@ -9,7 +7,7 @@
|
|||||||
|
|
||||||
<ImageView>
|
<ImageView>
|
||||||
<image>
|
<image>
|
||||||
<Image url="@pics/Background.png"></Image>
|
<Image url="@pics/Background.png" />
|
||||||
</image>
|
</image>
|
||||||
</ImageView>
|
</ImageView>
|
||||||
|
|
||||||
|
82
gitignore
82
gitignore
@ -1,82 +0,0 @@
|
|||||||
# Mobile Tools for Java (J2ME)
|
|
||||||
.mtj.tmp/
|
|
||||||
|
|
||||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
|
||||||
hs_err_pid*
|
|
||||||
|
|
||||||
### JetBrains template
|
|
||||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
|
|
||||||
|
|
||||||
|
|
||||||
*.iml
|
|
||||||
|
|
||||||
## Directory-based project format:
|
|
||||||
.idea/
|
|
||||||
# if you remove the above rule, at least ignore the following:
|
|
||||||
|
|
||||||
|
|
||||||
# User-specific stuff:
|
|
||||||
# .idea/workspace.xml
|
|
||||||
# .idea/tasks.xml
|
|
||||||
# .idea/dictionaries
|
|
||||||
|
|
||||||
|
|
||||||
# Sensitive or high-churn files:
|
|
||||||
# .idea/dataSources.ids
|
|
||||||
# .idea/dataSources.xml
|
|
||||||
# .idea/sqlDataSources.xml
|
|
||||||
# .idea/dynamic.xml
|
|
||||||
# .idea/uiDesigner.xml
|
|
||||||
|
|
||||||
# Gradle:
|
|
||||||
# .idea/gradle.xml
|
|
||||||
# .idea/libraries
|
|
||||||
|
|
||||||
|
|
||||||
# Mongo Explorer plugin:
|
|
||||||
# .idea/mongoSettings.xml
|
|
||||||
|
|
||||||
## File-based project format:
|
|
||||||
*.ipr
|
|
||||||
*.iws
|
|
||||||
|
|
||||||
## Plugin-specific files:
|
|
||||||
|
|
||||||
# IntelliJ
|
|
||||||
/out/
|
|
||||||
|
|
||||||
# mpeltonen/sbt-idea plugin
|
|
||||||
.idea_modules/
|
|
||||||
|
|
||||||
# JIRA plugin
|
|
||||||
atlassian-ide-plugin.xml
|
|
||||||
|
|
||||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
|
||||||
com_crashlytics_export_strings.xml
|
|
||||||
crashlytics.properties
|
|
||||||
crashlytics-build.properties
|
|
||||||
|
|
||||||
|
|
||||||
# Created by .ignore support plugin (hsz.mobi)
|
|
||||||
|
|
||||||
|
|
||||||
# Compiled class file
|
|
||||||
*.class
|
|
||||||
|
|
||||||
# Log file
|
|
||||||
*.log
|
|
||||||
|
|
||||||
|
|
||||||
# Package Files #
|
|
||||||
*.jar
|
|
||||||
*.war
|
|
||||||
*.nar
|
|
||||||
*.ear
|
|
||||||
*.zip
|
|
||||||
*.tar.gz
|
|
||||||
*.rar
|
|
||||||
|
|
||||||
Happy_Bird/.gradle/
|
|
||||||
Happy_Bird/app/build/
|
|
||||||
Happy_Bird/data/build/
|
|
||||||
Happy_Bird/.gradle/buildOutputCleanup/
|
|
Loading…
x
Reference in New Issue
Block a user