Start des Spielscreens
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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.control.Slider;
|
||||
import javafx.scene.image.*;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.scene.text.TextAlignment;
|
||||
import javafx.stage.Stage;
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
|
||||
public class GameScreen extends HappyBirdMain
|
||||
{
|
||||
|
||||
}
|
@@ -35,15 +35,25 @@ public class HappyBirdMain extends Application {
|
||||
stage.setScene(scene);
|
||||
|
||||
//Backgroundimage
|
||||
Image image = new Image("file:src/main/resources/com/example/happy_bird/pics/Background.png");
|
||||
Image backgroundImage = new Image("file:src/main/resources/com/example/happy_bird/pics/Background.png");
|
||||
BackgroundImage backgroundImageImg = new BackgroundImage(
|
||||
image,
|
||||
backgroundImage,
|
||||
BackgroundRepeat.NO_REPEAT,
|
||||
BackgroundRepeat.NO_REPEAT,
|
||||
BackgroundPosition.DEFAULT,
|
||||
BackgroundSize.DEFAULT
|
||||
);
|
||||
|
||||
Image bird = new Image("file:src/main/resources/com/example/happy_bird/pics/bird.png", 50, 50, false, false);
|
||||
/*ImageView birdView = new ImageView();
|
||||
birdView.setFitHeight(50);
|
||||
birdView.setFitWidth(50);
|
||||
birdView.setLayoutX(50);
|
||||
birdView.setLayoutY(325);
|
||||
|
||||
*/
|
||||
|
||||
|
||||
Background background = new Background(backgroundImageImg);
|
||||
pane.setBackground(background);
|
||||
|
||||
@@ -185,8 +195,22 @@ public class HappyBirdMain extends Application {
|
||||
});
|
||||
|
||||
|
||||
//startGame.setOnAction(event -> {});
|
||||
//startButton.setOnAction(event -> {});
|
||||
startGame.setOnAction(event -> {
|
||||
for(TextField feld : inputFields) {
|
||||
feld.setVisible(false);
|
||||
}
|
||||
for (Label label : startLabels )
|
||||
{
|
||||
label.setVisible(false);
|
||||
}
|
||||
startGame.setVisible(false);
|
||||
menuButton.setVisible(false);
|
||||
headline.setVisible(false);
|
||||
ImageView birdView = new ImageView(bird);
|
||||
pane.getChildren().add(birdView);
|
||||
birdView.setLayoutY(325);
|
||||
birdView.setLayoutX(50);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user