diff --git a/app/src/main/java/school_project/Menu/MenuAcceuil.java b/app/src/main/java/school_project/Menu/MenuAcceuil.java index e243179..e94de05 100644 --- a/app/src/main/java/school_project/Menu/MenuAcceuil.java +++ b/app/src/main/java/school_project/Menu/MenuAcceuil.java @@ -15,8 +15,6 @@ public class MenuAcceuil extends BorderPane { private Button Play; public static Button SelectLevel; private Button Trophy; - private Scene scene; - private BorderPane BdP; private Label Title; @@ -38,7 +36,7 @@ public class MenuAcceuil extends BorderPane { setAlignment(Trophy,Pos.CENTER); //Menu.getStylesheets().add("style.css"); todo creat a file css setPadding(new Insets(20,60,20,60)); - //need help to add MenuAcceuil + } diff --git a/app/src/main/java/school_project/Menu/MenuLevel.java b/app/src/main/java/school_project/Menu/MenuLevel.java new file mode 100644 index 0000000..15045a7 --- /dev/null +++ b/app/src/main/java/school_project/Menu/MenuLevel.java @@ -0,0 +1,57 @@ +package school_project.Menu; + +import javafx.scene.control.Button; +import javafx.scene.layout.GridPane; + + +public class MenuLevel extends GridPane { + public Button BckMenu; + public Button[] Days = new Button[3]; + public int StartLevel; + + public MenuLevel(int choose_day) { + BckMenu = new Button("Back to menu"); + for (int i = 0; i < Days.length; i++) { + int a = 1; + Days[i] = new Button(Integer.toString(a)); + a += 1; + } + if (choose_day == 1) + StartLevel = 1; + + if (choose_day == 2) + StartLevel = 11; + if (choose_day == 3) + StartLevel = 21; + + GridPane GdP = new GridPane(); + for (int i = 0; i < 3; i++) { + if (i == 1) + StartLevel=2; + else if (i ==2) + StartLevel=3; + for (int j = 0; j < 4; j++) { + if(i==0){ + Button Level = new Button(Integer.toString(StartLevel)); + StartLevel+=3; + GdP.add(Level,i,j); + } + else if(i==1&&j!=3){ + Button Level = new Button(Integer.toString(StartLevel)); + StartLevel+=3; + GdP.add(Level,i,j); + } + else if(i==2&&j!=3){ + Button Level = new Button(Integer.toString(StartLevel)); + StartLevel+=3; + GdP.add(Level,i,j); + } + + + + } + } + getChildren().addAll(GdP); + } +} +