ScreenLevelFinish #64

Merged
Mat_02 merged 11 commits from ScreenLevelFinish into master 2023-05-18 19:03:56 +02:00
Showing only changes of commit 1df3918718 - Show all commits

View File

@ -2,33 +2,40 @@ package school_project.Menu;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import school_project.Controller;
public class MenuAccueil extends BorderPane {
public class MenuAccueil extends StackPane {
public MenuAccueil(){
super();
//create all the objet that i need
Button Play = new Button("Play");
//create all the objet that I need
ChoiceBox SlctDifficulty = new ChoiceBox();
SlctDifficulty.getItems().addAll("Easy", "Medium", "Hard");
Label RdmLvl = new Label("Random Level : ");
Button SelectLevel= new Button("Select Level");
Button Trophy = new Button("Trophy");
Label Title = new Label("Welcome to Road to Master");
//set up all the Button where i need
setTop(Title);
setLeft(Play);
setRight(SelectLevel);
setBottom(Trophy);
Title.setFont(Font.font(20));
Title.setTextFill(Color.GOLD);
setAlignment(Title, Pos.CENTER);
setAlignment(Play,Pos.CENTER);
setAlignment(SelectLevel,Pos.CENTER);
setAlignment(Trophy,Pos.CENTER);
setPadding(new Insets(20,60,20,60));
//set up all the Button where I need
getChildren().addAll(Title,SlctDifficulty,SelectLevel,RdmLvl);
RdmLvl.setFont(Font.font(25));
RdmLvl.setTextFill(Color.GOLD);
Title.setFont(Font.font(40));
Title.setTextFill(Color.RED);
setAlignment(Title, Pos.TOP_CENTER);
setAlignment(SlctDifficulty,Pos.CENTER_LEFT);
setAlignment(SelectLevel,Pos.CENTER_RIGHT);
setAlignment(RdmLvl, Pos.CENTER_LEFT);
setMargin(RdmLvl,new Insets(0,0,0,100));
Mat_02 marked this conversation as resolved
Review

Le MapGenerator.generate() retourne une Map
Cette Map doit ensuite être chargée par GameUI(Map)

Il faudrait du coup

SlctDifficulty.setOnAction(event1 -> Controller.switchRoot(new GameUI(MapGenerator.generate(MapGenerator.Difficulty.Difficult))); 
Le `MapGenerator.generate()` retourne une `Map` Cette Map doit ensuite être chargée par `GameUI(Map)` Il faudrait du coup ```java SlctDifficulty.setOnAction(event1 -> Controller.switchRoot(new GameUI(MapGenerator.generate(MapGenerator.Difficulty.Difficult))); ```
setMargin(SlctDifficulty,new Insets(0,0,0,300));
setMargin(SelectLevel,new Insets(0,300,0,0));
setMargin(Title,new Insets(200,0,0,0));
SelectLevel.setOnAction(event -> Controller.switchRoot(new MenuLevel(1)));
getStyleClass().add("BorderPane");
getStylesheets().add(String.valueOf(getClass().getResource("StyleMenuAcceuil.css")));