ScreenLevelFinish #64
@ -2,7 +2,8 @@ package school_project;
|
|||||||
|
|
||||||
import javafx.scene.Group;
|
import javafx.scene.Group;
|
||||||
import javafx.scene.input.MouseButton;
|
import javafx.scene.input.MouseButton;
|
||||||
import school_project.Menu.MenuAccueil;
|
|
||||||
|
import school_project.Menu.ScreenLevelFinish;
|
||||||
import school_project.Utils.MatrixShape;
|
import school_project.Utils.MatrixShape;
|
||||||
|
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
@ -76,7 +77,7 @@ public class GameUI extends Group{
|
|||||||
_piece.setLayoutY(grid.getLayoutY() + p.getPosition().x * (SEGMENT_SIZE+SPACE_SIZE));
|
_piece.setLayoutY(grid.getLayoutY() + p.getPosition().x * (SEGMENT_SIZE+SPACE_SIZE));
|
||||||
}
|
}
|
||||||
if(level.gameDone()){
|
if(level.gameDone()){
|
||||||
Controller.switchRoot(new MenuAccueil());
|
Controller.switchRoot(new ScreenLevelFinish());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -57,6 +57,7 @@ public class MenuAccueil extends StackPane {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//set up all the Button where I need
|
//set up all the Button where I need
|
||||||
|
|
||||||
getChildren().addAll(Title,SlctDifficulty,SelectLevel,RdmLvl,LoadLvl);
|
getChildren().addAll(Title,SlctDifficulty,SelectLevel,RdmLvl,LoadLvl);
|
||||||
RdmLvl.setFont(Font.font(25));
|
RdmLvl.setFont(Font.font(25));
|
||||||
RdmLvl.setTextFill(Color.GOLD);
|
RdmLvl.setTextFill(Color.GOLD);
|
||||||
|
38
app/src/main/java/school_project/Menu/ScreenLevelFinish.java
Normal file
38
app/src/main/java/school_project/Menu/ScreenLevelFinish.java
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
package school_project.Menu;
|
||||||
|
|
||||||
|
|
||||||
|
import javafx.geometry.Insets;
|
||||||
|
import javafx.geometry.Pos;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
|
|
||||||
|
import javafx.scene.layout.StackPane;
|
||||||
|
import javafx.scene.text.Font;
|
||||||
|
import school_project.Controller;
|
||||||
|
|
||||||
|
public class ScreenLevelFinish extends StackPane {
|
||||||
|
|
||||||
|
public ScreenLevelFinish(){
|
||||||
|
|||||||
|
super();
|
||||||
|
Label CongraMess = new Label(" LEVEL DONE GREAT JOB ");
|
||||||
|
CongraMess.setFont(Font.font(40));
|
||||||
|
Button BckMenu = new Button("Back to Menu");
|
||||||
|
BckMenu.setFont(Font.font(25));
|
||||||
|
Button ChooseLvl = new Button("Choose level");
|
||||||
|
ChooseLvl.setFont(Font.font(25));
|
||||||
|
|
||||||
|
BckMenu.setOnAction(event -> Controller.switchRoot(new MenuAccueil()));
|
||||||
|
ChooseLvl.setOnAction(event -> Controller.switchRoot(new MenuLevel(1)));
|
||||||
|
|
||||||
|
getChildren().addAll(BckMenu,ChooseLvl,CongraMess);
|
||||||
|
setAlignment(BckMenu, Pos.CENTER_RIGHT);
|
||||||
|
setAlignment(ChooseLvl, Pos.CENTER_LEFT);
|
||||||
|
setAlignment(CongraMess, Pos.TOP_CENTER);
|
||||||
|
setMargin(BckMenu, new Insets(0,300,0,0 ));
|
||||||
|
setMargin(ChooseLvl,new Insets(0,0,0,300));
|
||||||
|
setMargin(CongraMess,new Insets(300,0,0,0));
|
||||||
|
|
||||||
|
getStyleClass().add("StackPane");
|
||||||
|
getStylesheets().add(String.valueOf(getClass().getResource("StyleMenuAcceuil.css")));
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 237 KiB |
@ -5,4 +5,7 @@
|
|||||||
.GridPane{
|
.GridPane{
|
||||||
-fx-background-image: url("Background-select-level.jpg");
|
-fx-background-image: url("Background-select-level.jpg");
|
||||||
-fx-background-position:right;
|
-fx-background-position:right;
|
||||||
|
}
|
||||||
|
.StackPane{
|
||||||
|
-fx-background-image: url("BackGround-LvlFinish.jpg");
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user
Peut être que tu peux ajouter le numéro du niveau dans le constructeur pour l'afficher et demander soit si ils veulent le retenter, soit jouer au suivant.
Remarque, pour les niveaux généré aléatoirement à la place du niveau il faudrait avoir l'objet Map du niveau passé dans le constructeur pour rédémarer le niveau ^