diff --git a/code/.idea/shelf/Uncommitted_changes_before_Update_at_20_01_2022_21_57_[Default_Changelist]/shelved.patch b/code/.idea/shelf/Uncommitted_changes_before_Update_at_20_01_2022_21_57_[Default_Changelist]/shelved.patch new file mode 100644 index 0000000..38ae9aa --- /dev/null +++ b/code/.idea/shelf/Uncommitted_changes_before_Update_at_20_01_2022_21_57_[Default_Changelist]/shelved.patch @@ -0,0 +1,2270 @@ +Index: src/controller/GameConfigMenuController.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package controller;\n\nimport javafx.event.ActionEvent;\nimport javafx.fxml.FXML;\nimport javafx.fxml.FXMLLoader;\nimport javafx.fxml.Initializable;\nimport javafx.scene.Parent;\nimport javafx.scene.Scene;\nimport javafx.scene.control.*;\nimport javafx.scene.image.Image;\nimport javafx.scene.image.ImageView;\nimport javafx.scene.input.MouseEvent;\nimport javafx.scene.layout.AnchorPane;\nimport javafx.stage.Stage;\nimport javafx.stage.Window;\n\nimport java.net.URL;\nimport java.util.Objects;\nimport java.util.ResourceBundle;\n\npublic class GameConfigMenuController implements Initializable {\n\n @FXML private AnchorPane levelRoot;\n\n @FXML private RadioButton radioButton1;\n @FXML private RadioButton radioButton2;\n @FXML private RadioButton radioButton3;\n @FXML private Button button1;\n @FXML private MenuItem choice1;\n @FXML private MenuItem choice2;\n @FXML private MenuItem choice3;\n @FXML private ImageView ImageChange;\n @FXML private ToggleGroup group;\n\n private int personnage;\n private int difficulty;\n\n @Override\n public void initialize(URL url, ResourceBundle resourceBundle) {\n radioButton1.setToggleGroup(group);\n radioButton2.setToggleGroup(group);\n radioButton3.setToggleGroup(group);\n }\n\n @FXML void changeSkin1(ActionEvent event){\n ImageChange.setImage(new Image(\"/image/personnage/Perso1.2.png\"));\n this.personnage = 1;\n }\n @FXML void changeSkin2(ActionEvent event){\n ImageChange.setImage(new Image(\"/image/personnage/Perso2.2.png\"));\n this.personnage = 2;\n }\n @FXML void changeSkin3(ActionEvent event){\n ImageChange.setImage(new Image(\"/image/personnage/Perso3.2.png\"));\n this.personnage = 3;\n }\n\n @FXML void setDifficulty1(MouseEvent event){\n this.difficulty = 1;\n }\n @FXML void setDifficulty2(MouseEvent event){\n this.difficulty = 2;\n }\n @FXML void setDifficulty3(MouseEvent event){\n this.difficulty = 3;\n }\n\n @FXML\n void launchGame(MouseEvent event) throws Exception {\n FXMLLoader loader = new FXMLLoader(getClass().getResource(\"/fxml/viewGame2.fxml\"));\n Parent pane = loader.load();\n GamePlayController gp = loader.getController();\n if(this.difficulty == 0){\n this.difficulty = 1;\n }\n gp.difficulty = this.difficulty;\n if(this.personnage == 0){\n this.personnage = 1;\n }\n gp.perso = this.personnage;\n gp.gameLauncher();\n\n Stage a = new Stage();\n a.setScene(new Scene(pane, 1300, 900));\n a.setResizable(false);\n a.show();\n Stage stage = (Stage) levelRoot.getScene().getWindow();\n stage.close();\n }\n\n @FXML\n void returnToMenu(MouseEvent event) throws Exception{\n AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource(\"/fxml/MainPage.fxml\")));\n levelRoot.getChildren().setAll(pane);\n }\n\n}\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/controller/GameConfigMenuController.java b/src/controller/GameConfigMenuController.java +--- a/src/controller/GameConfigMenuController.java (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) ++++ b/src/controller/GameConfigMenuController.java (date 1642710847115) +@@ -35,6 +35,11 @@ + private int personnage; + private int difficulty; + ++ /** ++ * Initializes the controller class. ++ * @param url ++ * @param resourceBundle ++ */ + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + radioButton1.setToggleGroup(group); +@@ -42,29 +47,62 @@ + radioButton3.setToggleGroup(group); + } + ++ /** ++ * Method to change the skin of the player one ++ * @param event ++ */ + @FXML void changeSkin1(ActionEvent event){ + ImageChange.setImage(new Image("/image/personnage/Perso1.2.png")); + this.personnage = 1; + } ++ ++ /** ++ * Method to change the skin of the player two ++ * @param event ++ */ + @FXML void changeSkin2(ActionEvent event){ + ImageChange.setImage(new Image("/image/personnage/Perso2.2.png")); + this.personnage = 2; + } ++ ++ /** ++ * Method to change the skin of the player three ++ * @param event ++ */ + @FXML void changeSkin3(ActionEvent event){ + ImageChange.setImage(new Image("/image/personnage/Perso3.2.png")); + this.personnage = 3; + } + ++ /** ++ * Method to set the difficulty to 1 ++ * @param event ++ */ + @FXML void setDifficulty1(MouseEvent event){ + this.difficulty = 1; + } ++ ++ /** ++ * Method to set the difficulty to 2 ++ * @param event ++ */ + @FXML void setDifficulty2(MouseEvent event){ + this.difficulty = 2; + } ++ ++ /** ++ * Method to set the difficulty to 3 ++ * @param event ++ */ + @FXML void setDifficulty3(MouseEvent event){ + this.difficulty = 3; + } + ++ /** ++ * Method to start the game ++ * @param event ++ * @throws Exception ++ */ + @FXML + void launchGame(MouseEvent event) throws Exception { + FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/viewGame2.fxml")); +@@ -88,6 +126,11 @@ + stage.close(); + } + ++ /** ++ * Method to go back to the main menu ++ * @param event ++ * @throws Exception ++ */ + @FXML + void returnToMenu(MouseEvent event) throws Exception{ + AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/MainPage.fxml"))); +Index: src/controller/MapController.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package controller;\n\nimport javafx.fxml.Initializable;\nimport javafx.scene.image.Image;\nimport javafx.scene.image.ImageView;\nimport javafx.scene.layout.AnchorPane;\nimport javafx.scene.layout.GridPane;\nimport model.Case;\nimport model.Map;\n\nimport java.util.ArrayList;\n\npublic class MapController implements Initializable {\n\n private final Map map = new Map(32,30);\n private final Image b = new Image(\"/image/terrain/chemin.png\");\n private final Image a = new Image(\"/image/terrain/herbe.png\");\n private final Image c = new Image(\"/image/terrain/arbre2hg.png\");\n private final Image d = new Image(\"/image/terrain/arbre2hd.png\");\n private final Image e = new Image(\"/image/terrain/arbre2bg.png\");\n private final Image f = new Image(\"/image/terrain/arbre2bd.png\");\n private final Image g = new Image(\"/image/terrain/eventail.png\");\n private final Image h = new Image(\"/image/terrain/salade.png\");\n private final Image i = new Image(\"/image/terrain/foin1hg.png\");\n private final Image j = new Image(\"/image/terrain/foin1hd.png\");\n private final Image k = new Image(\"/image/terrain/foin1bg.png\");\n private final Image l = new Image(\"/image/terrain/foin1bd.png\");\n private final Image m = new Image(\"/image/terrain/arbuste1.png\");\n private final Image n = new Image(\"/image/terrain/arbuste2.png\");\n private final Image o = new Image(\"/image/terrain/arbuste2.png\");\n private final Image p = new Image(\"/image/terrain/arbre1h.png\");\n private final Image q = new Image(\"/image/terrain/arbre1b.png\");\n private final Image r = new Image(\"/image/terrain/tronc2g.png\");\n private final Image s = new Image(\"/image/terrain/tronc2d.png\");\n private final Image t = new Image(\"/image/terrain/tronc1g.png\");\n private final Image u = new Image(\"/image/terrain/tronc1d.png\");\n private final Image v = new Image(\"/image/terrain/souche1.png\");\n private final Image w = new Image(\"/image/terrain/chemin.png\");\n private final Image x = new Image(\"/image/terrain/multiarbre1.png\");\n private final Image y = new Image(\"/image/terrain/multiarbre2.png\");\n private final Image z1 = new Image(\"/image/terrain/bonus.png\");\n private final Image z2 = new Image(\"/image/terrain/malus\" + \".png\");\n private final Image aa = new Image(\"/image/terrain/pierre2.png\");\n private final Image ab = new Image(\"/image/terrain/pierre1.png\");\n private final Image ac = new Image(\"/image/terrain/tombe1.png\");\n private final Image ad = new Image(\"/image/terrain/statue1h.png\");\n private final Image ae = new Image(\"/image/terrain/statue1b.png\");\n private final Image af = new Image(\"/image/terrain/tronc3h.png\");\n private final Image ag = new Image(\"/image/terrain/tronc3b.png\");\n private final Image ah = new Image(\"/image/terrain/souche2.png\");\n private final Image ai = new Image(\"/image/terrain/herbe2.png\");\n private final Image aj = new Image(\"/image/terrain/puit1hg.png\");\n private final Image ak = new Image(\"/image/terrain/puit1hd.png\");\n private final Image al = new Image(\"/image/terrain/puit1bg.png\");\n private final Image am = new Image(\"/image/terrain/puit1bd.png\");\n //private final int[][] coordFirstDifficultyMap = {{0,24},{1,24},{2,24},{3,24},{4,24},{5,24},{5,23},{5,22},{5,21},{5,20},{5,19},{5,18},{6,18},{7,18},{8,18},{9,18},{10,18},{11,18},{12,18},{12,17},{12,16},{12,15},{12,14},{12,13},{12,12},{11,12},{10,12},{9,12},{8,12},{7,12},{6,12},{5,12},{4,12},{3,12},{3,11},{3,10},{3,9},{3,8},{3,7},{3,6},{3,5},{3,4},{3,3},{4,3},{5,3},{6,3},{7,3},{8,3},{9,3},{10,3},{11,3},{12,3},{13,3},{14,3},{15,3},{16,3},{17,3},{18,3},{19,3},{19,4},{19,5},{19,6},{19,7},{19,8},{19,9},{19,10},{20,10},{21,10},{22,10},{23,10},{24,10},{24,11},{24,12},{24,13},{24,14},{24,15},{24,16},{24,17},{24,18},{24,19},{24,20},{24,21},{24,22},{24,23},{24,24},{25,24},{26,24},{27,24},{28,24},{29,24}};\n private final int[][] coordSecondDifficultyMap = {{17,0},{17,1},{17,2},{17,3},{17,4},{18,4},{19,4},{20,4},{21,4},{22,4},{23,4},{24,4},{25,4},{25,5},{25,6},{25,7},{25,8},{25,9},{25,10},{25,11},{25,12},{25,13},{25,14},{24,14},{23,14},{22,14},{21,14},{20,14},{20,15},{19,15},{18,15},{17,15},{16,15},{15,15},{15,14},{15,13},{15,12},{15,11},{15,10},{14,10},{13,10},{12,10},{11,10},{10,10},{9,10},{8,10},{7,10},{6,10},{5,10},{4,10},{3,10},{2,10},{2,11},{2,12},{2,13},{2,14},{2,15},{2,16},{2,17},{2,17},{3,17},{4,17},{5,17},{6,17},{7,17},{8,17},{9,17},{9,18},{9,19},{9,20},{9,21},{9,22},{9,23},{9,24},{9,25},{10,25},{11,25},{12,25},{13,25},{14,25},{15,25},{16,25},{17,25},{18,25},{19,25},{20,25},{21,25},{22,25},{23,25},{24,25},{25,25},{26,25},{27,25},{28,25},{29,25}};\n private final int[][] coordThirdDifficultyMap = {{28,0},{28,1},{28,2},{28,3},{27,3},{26,3},{25,3},{24,3},{23,3},{22,3},{21,3},{20,3},{19,3},{18,3},{17,3},{16,3},{15,3},{14,3},{13,3},{12,3},{11,3},{10,3},{9,3},{8,3},{7,3},{6,3},{5,3},{4,3},{3,3},{3,4},{3,5},{3,6},{3,7},{4,7},{5,7},{6,7},{7,7},{8,7},{9,7},{10,7},{10,8},{10,9},{11,9},{12,9},{13,9},{14,9},{15,9},{16,9},{17,9},{18,9},{19,9},{20,9},{21,9},{22,9},{23,9},{23,10},{23,11},{23,12},{23,13},{23,14},{24,14},{25,14},{26,14},{26,15},{26,16},{26,17},{26,18},{26,19},{26,20},{26,21},{26,22},{26,23},{26,24},{26,25},{25,25},{24,25},{23,25},{22,25},{21,25},{20,25},{19,25},{18,25},{17,25},{16,25},{15,25},{14,25},{13,25},{12,25},{11,25},{10,25},{9,25},{8,25},{7,25},{6,25},{5,25},{4,25},{3,25},{2,25},{1,25},{1,24},{1,23},{1,22},{1,21},{1,20},{1,19},{2,19},{3,19},{4,19},{5,19},{6,19},{7,19},{8,19},{9,19},{10,19},{11,19},{12,19},{13,19},{13,18},{13,17},{13,16},{13,15},{13,14},{12,14},{11,14},{10,14},{9,14},{8,14},{7,14},{6,14},{5,14},{4,14},{3,14},{2,14},{1,14},{0,14}};\n private int[][] coordMap = {};\n private final int[][] coordFirstDifficultyMap = {{0,24},{1,24},{2,24},{3,24},{4,24},{5,24},{5,23},{5,22},{5,21}};\n\n @Override\n public void initialize(java.net.URL location, java.util.ResourceBundle resources) {\n }\n\n public void createMap(int difficulty) {\n\n int j = 1, k;\n if(difficulty==1){\n coordMap = coordFirstDifficultyMap;\n }else{\n if (difficulty==2){\n coordMap = coordSecondDifficultyMap;\n }else{\n coordMap = coordThirdDifficultyMap;\n }\n }\n for(int[] i : coordMap){\n boolean boolStart = j == 1;\n boolean boolEnd = j == coordMap.length;\n boolean bonus = false, malus = false;\n\n if(difficulty == 1) k = (int) (Math.random() * 10);\n else if(difficulty == 2) k = (int) (Math.random() * 8);\n else k = (int) (Math.random() * 6);\n\n if(k == 1 || k == 2) bonus = true;\n else if(k == 3) malus = true;\n\n System.out.println(\"X : \" + i[0] + \" Y : \" + i[1] + \" Start : \" + boolStart + \" End : \" + boolEnd + \" Bonus : \" + bonus + \" Malus : \" + malus);\n Case case1 = new Case(j, i[0], i [1], boolStart, bonus, malus, boolEnd, map);\n map.addCase(case1);\n j++;\n }\n\n\n if (difficulty != 1 && difficulty != 2 && difficulty != 3) {\n System.out.println(\"Difficulty not found\");\n }\n }\n\n public AnchorPane mapInitialisation(int difficulty) {\n\n int tileSize = 32;\n if(difficulty == 1){\n\n Image[][] grid = {\n {a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,b,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,b,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,b,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,b,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,b,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,b,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,b,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,b,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,b,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,b,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,b,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,b,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,b,a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,o,o,q,o,o,c,d,o,o,o},\n {y,x,y,x,y,x,y,x,y,d,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,e,f,o,o,o}\n };\n\n GridPane gridPane = new GridPane();\n\n // for visualizing the different squares:\n\n gridPane.setStyle(\"-fx-background-color: grey;\");\n\n for (int y = 0 ; y < grid.length ; y++) {\n for (int x = 0 ; x < grid[y].length ; x++) {\n ImageView imageView = new ImageView(grid[y][x]);\n imageView.setFitWidth(tileSize);\n imageView.setFitHeight(tileSize);\n gridPane.add(imageView, x, y);\n }\n }\n\n for (int y = 0 ; y < grid2.length ; y++) {\n for (int x = 0 ; x < grid2[y].length ; x++) {\n if(grid2[y][x] == o) continue;\n ImageView imageView = new ImageView(grid2[y][x]);\n imageView.setFitWidth(tileSize);\n imageView.setFitHeight(tileSize);\n gridPane.add(imageView, x, y);\n }\n }\n\n createMap(difficulty);\n ArrayList array = map.getMap();\n\n for (int y = 0 ; y < grid.length ; y++) {\n for (int x = 0 ; x < grid[y].length ; x++) {\n if(grid[y][x] != b) continue;\n for(Case c : array) {\n if (c.getCoordY() == y && c.getCoordX() == x && c.isBonus()) {\n ImageView imageView = new ImageView(z1);\n imageView.setFitWidth(tileSize);\n imageView.setFitHeight(tileSize);\n gridPane.add(imageView, x, y);\n }\n else if(c.getCoordY() == y && c.getCoordX() == x && c.isMalus()){\n ImageView imageView = new ImageView(z2);\n imageView.setFitWidth(tileSize);\n imageView.setFitHeight(tileSize);\n gridPane.add(imageView, x, y);\n }\n }\n }\n }\n\n AnchorPane FirstAnchor = new AnchorPane();\n FirstAnchor.getChildren().addAll(gridPane);\n return FirstAnchor;\n }\n\n else if(difficulty == 2){\n\n Image[][] grid = {\n {a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,b,a,a,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,b,a,a,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,a,a,a,a,a,a,a,a,a,a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o,o,o,o,o,q,o,o,ab,o,o,o,o,o,o,ai,o,o,o,o,c,d},\n {o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,p,o,o,o,c,d,o,o,o,o,ai,o,e,f},\n {o,o,ac,o,ac,o,ac,o,o,o,o,o,n,o,o,o,q,o,o,o,e,f,o,n,o,o,o,o,o,o},\n {u,o,o,o,o,o,o,o,o,o,o,ai,o,o,ab,o,o,ai,o,o,o,o,o,o,o,o,o,o,o,o},\n {c,d,c,d,c,d,o,aa,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o},\n {x,y,x,y,x,y,d,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o},\n {y,x,y,x,y,x,y,d,c,d,c,d,c,d,c,d,c,d,c,d,c,d,c,d,c,d,c,d,c,d},\n {x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y},\n {y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x},\n {x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y}\n };\n\n GridPane gridPane = new GridPane();\n\n // for visualizing the different squares:\n\n gridPane.setStyle(\"-fx-background-color: grey;\");\n\n for (int y = 0 ; y < grid.length ; y++) {\n for (int x = 0 ; x < grid[y].length ; x++) {\n ImageView imageView = new ImageView(grid[y][x]);\n imageView.setFitWidth(tileSize);\n imageView.setFitHeight(tileSize);\n gridPane.add(imageView, x, y);\n }\n }\n\n for (int y = 0 ; y < grid2.length ; y++) {\n for (int x = 0 ; x < grid2[y].length ; x++) {\n if(grid2[y][x] == o) continue;\n ImageView imageView = new ImageView(grid2[y][x]);\n imageView.setFitWidth(tileSize);\n imageView.setFitHeight(tileSize);\n gridPane.add(imageView, x, y);\n }\n }\n\n createMap(difficulty);\n ArrayList array = map.getMap();\n\n for (int y = 0 ; y < grid.length ; y++) {\n for (int x = 0 ; x < grid[y].length ; x++) {\n if(grid[y][x] != b) continue;\n for(Case c : array) {\n if (c.getCoordY() == y && c.getCoordX() == x && c.isBonus()) {\n ImageView imageView = new ImageView(z1);\n imageView.setFitWidth(tileSize);\n imageView.setFitHeight(tileSize);\n gridPane.add(imageView, x, y);\n }\n else if(c.getCoordY() == y && c.getCoordX() == x && c.isMalus()){\n ImageView imageView = new ImageView(z2);\n imageView.setFitWidth(tileSize);\n imageView.setFitHeight(tileSize);\n gridPane.add(imageView, x, y);\n }\n }\n }\n }\n\n AnchorPane FirstAnchor = new AnchorPane();\n FirstAnchor.getChildren().addAll(gridPane);\n return FirstAnchor;\n }\n\n else{\n\n Image[][] grid = {\n {a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,b,a},\n {a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,b,a},\n {a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,b,a},\n {a,a,a,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,a},\n {a,a,a,b,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,b,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,b,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,b,b,b,b,b,b,b,b,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,a,a,a,a,a,a,a,b,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a},\n {a,a,a,a,a,a,a,a,a,a,b,b,b,b,b,b,b,b,b,b,b,b,b,b,a,a,a,a,a,a},\n {a,a,a,a,a,a,a,a,a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o,o,p,o,n,o,e,f,o,o,o,o,q,o,c,d,o,o,q,o,ai,o,e,f,o,n,o},\n {o,o,r,s,o,q,o,o,o,o,o,o,ai,o,o,o,o,e,f,o,o,o,o,o,o,o,o,r,s,o}\n };\n\n GridPane gridPane = new GridPane();\n\n // for visualizing the different squares:\n\n gridPane.setStyle(\"-fx-background-color: grey;\");\n\n for (int y = 0 ; y < grid.length ; y++) {\n for (int x = 0 ; x < grid[y].length ; x++) {\n ImageView imageView = new ImageView(grid[y][x]);\n imageView.setFitWidth(tileSize);\n imageView.setFitHeight(tileSize);\n gridPane.add(imageView, x, y);\n }\n }\n\n for (int y = 0 ; y < grid2.length ; y++) {\n for (int x = 0 ; x < grid2[y].length ; x++) {\n if(grid2[y][x] == o) continue;\n ImageView imageView = new ImageView(grid2[y][x]);\n imageView.setFitWidth(tileSize);\n imageView.setFitHeight(tileSize);\n gridPane.add(imageView, x, y);\n }\n }\n\n createMap(difficulty);\n ArrayList array = map.getMap();\n\n for (int y = 0 ; y < grid.length ; y++) {\n for (int x = 0 ; x < grid[y].length ; x++) {\n if(grid[y][x] != b) continue;\n for(Case c : array) {\n if (c.getCoordY() == y && c.getCoordX() == x && c.isBonus()) {\n ImageView imageView = new ImageView(z1);\n imageView.setFitWidth(tileSize);\n imageView.setFitHeight(tileSize);\n gridPane.add(imageView, x, y);\n }\n else if(c.getCoordY() == y && c.getCoordX() == x && c.isMalus()){\n ImageView imageView = new ImageView(z2);\n imageView.setFitWidth(tileSize);\n imageView.setFitHeight(tileSize);\n gridPane.add(imageView, x, y);\n }\n }\n }\n }\n\n AnchorPane FirstAnchor = new AnchorPane();\n FirstAnchor.getChildren().addAll(gridPane);\n return FirstAnchor;\n }\n }\n\n public Map getMap(){\n return this.map;\n }\n\n public Case getCaseStart(){\n return map.getStartCase();\n }\n\n public Case getNextCase(Case c){\n return map.getNextCase(c);\n }\n\n public Case getStartCase(){\n return map.getStartCase();\n }\n\n public Case getCase(Case c, int num){\n return map.getCase(c, num);\n }\n}\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/controller/MapController.java b/src/controller/MapController.java +--- a/src/controller/MapController.java (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) ++++ b/src/controller/MapController.java (date 1642712110254) +@@ -53,16 +53,25 @@ + private final Image ak = new Image("/image/terrain/puit1hd.png"); + private final Image al = new Image("/image/terrain/puit1bg.png"); + private final Image am = new Image("/image/terrain/puit1bd.png"); +- //private final int[][] coordFirstDifficultyMap = {{0,24},{1,24},{2,24},{3,24},{4,24},{5,24},{5,23},{5,22},{5,21},{5,20},{5,19},{5,18},{6,18},{7,18},{8,18},{9,18},{10,18},{11,18},{12,18},{12,17},{12,16},{12,15},{12,14},{12,13},{12,12},{11,12},{10,12},{9,12},{8,12},{7,12},{6,12},{5,12},{4,12},{3,12},{3,11},{3,10},{3,9},{3,8},{3,7},{3,6},{3,5},{3,4},{3,3},{4,3},{5,3},{6,3},{7,3},{8,3},{9,3},{10,3},{11,3},{12,3},{13,3},{14,3},{15,3},{16,3},{17,3},{18,3},{19,3},{19,4},{19,5},{19,6},{19,7},{19,8},{19,9},{19,10},{20,10},{21,10},{22,10},{23,10},{24,10},{24,11},{24,12},{24,13},{24,14},{24,15},{24,16},{24,17},{24,18},{24,19},{24,20},{24,21},{24,22},{24,23},{24,24},{25,24},{26,24},{27,24},{28,24},{29,24}}; ++ private final int[][] coordFirstDifficultyMap = {{0,24},{1,24},{2,24},{3,24},{4,24},{5,24},{5,23},{5,22},{5,21},{5,20},{5,19},{5,18},{6,18},{7,18},{8,18},{9,18},{10,18},{11,18},{12,18},{12,17},{12,16},{12,15},{12,14},{12,13},{12,12},{11,12},{10,12},{9,12},{8,12},{7,12},{6,12},{5,12},{4,12},{3,12},{3,11},{3,10},{3,9},{3,8},{3,7},{3,6},{3,5},{3,4},{3,3},{4,3},{5,3},{6,3},{7,3},{8,3},{9,3},{10,3},{11,3},{12,3},{13,3},{14,3},{15,3},{16,3},{17,3},{18,3},{19,3},{19,4},{19,5},{19,6},{19,7},{19,8},{19,9},{19,10},{20,10},{21,10},{22,10},{23,10},{24,10},{24,11},{24,12},{24,13},{24,14},{24,15},{24,16},{24,17},{24,18},{24,19},{24,20},{24,21},{24,22},{24,23},{24,24},{25,24},{26,24},{27,24},{28,24},{29,24}}; + private final int[][] coordSecondDifficultyMap = {{17,0},{17,1},{17,2},{17,3},{17,4},{18,4},{19,4},{20,4},{21,4},{22,4},{23,4},{24,4},{25,4},{25,5},{25,6},{25,7},{25,8},{25,9},{25,10},{25,11},{25,12},{25,13},{25,14},{24,14},{23,14},{22,14},{21,14},{20,14},{20,15},{19,15},{18,15},{17,15},{16,15},{15,15},{15,14},{15,13},{15,12},{15,11},{15,10},{14,10},{13,10},{12,10},{11,10},{10,10},{9,10},{8,10},{7,10},{6,10},{5,10},{4,10},{3,10},{2,10},{2,11},{2,12},{2,13},{2,14},{2,15},{2,16},{2,17},{2,17},{3,17},{4,17},{5,17},{6,17},{7,17},{8,17},{9,17},{9,18},{9,19},{9,20},{9,21},{9,22},{9,23},{9,24},{9,25},{10,25},{11,25},{12,25},{13,25},{14,25},{15,25},{16,25},{17,25},{18,25},{19,25},{20,25},{21,25},{22,25},{23,25},{24,25},{25,25},{26,25},{27,25},{28,25},{29,25}}; + private final int[][] coordThirdDifficultyMap = {{28,0},{28,1},{28,2},{28,3},{27,3},{26,3},{25,3},{24,3},{23,3},{22,3},{21,3},{20,3},{19,3},{18,3},{17,3},{16,3},{15,3},{14,3},{13,3},{12,3},{11,3},{10,3},{9,3},{8,3},{7,3},{6,3},{5,3},{4,3},{3,3},{3,4},{3,5},{3,6},{3,7},{4,7},{5,7},{6,7},{7,7},{8,7},{9,7},{10,7},{10,8},{10,9},{11,9},{12,9},{13,9},{14,9},{15,9},{16,9},{17,9},{18,9},{19,9},{20,9},{21,9},{22,9},{23,9},{23,10},{23,11},{23,12},{23,13},{23,14},{24,14},{25,14},{26,14},{26,15},{26,16},{26,17},{26,18},{26,19},{26,20},{26,21},{26,22},{26,23},{26,24},{26,25},{25,25},{24,25},{23,25},{22,25},{21,25},{20,25},{19,25},{18,25},{17,25},{16,25},{15,25},{14,25},{13,25},{12,25},{11,25},{10,25},{9,25},{8,25},{7,25},{6,25},{5,25},{4,25},{3,25},{2,25},{1,25},{1,24},{1,23},{1,22},{1,21},{1,20},{1,19},{2,19},{3,19},{4,19},{5,19},{6,19},{7,19},{8,19},{9,19},{10,19},{11,19},{12,19},{13,19},{13,18},{13,17},{13,16},{13,15},{13,14},{12,14},{11,14},{10,14},{9,14},{8,14},{7,14},{6,14},{5,14},{4,14},{3,14},{2,14},{1,14},{0,14}}; + private int[][] coordMap = {}; +- private final int[][] coordFirstDifficultyMap = {{0,24},{1,24},{2,24},{3,24},{4,24},{5,24},{5,23},{5,22},{5,21}}; ++ //private final int[][] coordFirstDifficultyMap = {{0,24},{1,24},{2,24},{3,24},{4,24},{5,24},{5,23},{5,22},{5,21}}; + ++ /** ++ * Initializes the controller class. ++ * @param location ++ * @param resources ++ */ + @Override + public void initialize(java.net.URL location, java.util.ResourceBundle resources) { + } + ++ /** ++ * Method which create the map ++ * @param difficulty ++ */ + public void createMap(int difficulty) { + + int j = 1, k; +@@ -99,6 +108,11 @@ + } + } + ++ /** ++ * Method which initialize the map ++ * @param difficulty ++ * @return ++ */ + public AnchorPane mapInitialisation(int difficulty) { + + int tileSize = 32; +@@ -468,22 +482,45 @@ + } + } + ++ /** ++ * Method to get the map ++ * @return map ++ */ + public Map getMap(){ + return this.map; + } + ++ /** ++ * Method to get the start case ++ * @return start case ++ */ + public Case getCaseStart(){ + return map.getStartCase(); + } + ++ /** ++ * Method which give the next case ++ * @param c ++ * @return next case ++ */ + public Case getNextCase(Case c){ + return map.getNextCase(c); + } + ++ /** ++ * Method which give the start case ++ * @return start case ++ */ + public Case getStartCase(){ + return map.getStartCase(); + } + ++ /** ++ * Method to get the case which is num case after the case c ++ * @param c ++ * @param num ++ * @return ++ */ + public Case getCase(Case c, int num){ + return map.getCase(c, num); + } +Index: src/launcher/Main.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package launcher;\n\nimport javafx.application.Application;\nimport javafx.fxml.FXMLLoader;\nimport javafx.scene.Parent;\nimport javafx.scene.Scene;\nimport javafx.stage.Stage;\nimport model.*;\n\nimport java.io.*;\nimport java.util.ArrayList;\nimport java.util.Objects;\n\npublic class Main extends Application {\n\n private static Database currentd;\n private Album song;\n\n @Override\n public void start(Stage primaryStage) throws Exception {\n\n deserialize();\n\n Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource(\"/fxml/MainPage.fxml\")));\n primaryStage.setTitle(\"The Adventurer\");\n primaryStage.setScene(new Scene(root, 900, 600));\n primaryStage.setResizable(false);\n primaryStage.show();\n\n //début musique\n ArrayList musiqueListe = new ArrayList();\n Musique song1 = new Musique(\"/musique/medieval_musique1.mp3\",211000);\n Musique song2 = new Musique(\"/musique/medieval_musique2.mp3\",248000);\n Musique song3 = new Musique(\"/musique/medieval_musique3.mp3\",248000);\n Musique song4 = new Musique(\"/musique/medieval_musique4.mp3\",209000);\n song = new Album(musiqueListe);\n song.addList(song1);\n song.addList(song2);\n song.addList(song3);\n song.addList(song4);\n song.play();\n }\n\n\n @Override\n public void stop(){\n System.out.println(\"Stopping\");\n song.stop();\n\n }\n\n\n public static Database getDatabase() {\n return currentd;\n }\n\n public static void serialize() throws IOException {\n try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(\"database.txt\"))) {\n out.writeObject(currentd);\n } finally {\n System.out.println(\"Saved!\");\n System.exit(0);\n }\n }\n\n public static void deserialize() throws ClassNotFoundException, IOException {\n ObjectInputStream in = null;\n try {\n in = new ObjectInputStream(new FileInputStream(\"database.txt\"));\n currentd = (Database) in.readObject();\n in.close();\n } catch (FileNotFoundException | NullPointerException e) {\n currentd = new Database();\n }\n }\n\n public static void main(String[] args) {\n launch(args);\n }\n}\n\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/launcher/Main.java b/src/launcher/Main.java +--- a/src/launcher/Main.java (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) ++++ b/src/launcher/Main.java (date 1642710416329) +@@ -13,14 +13,15 @@ + + public class Main extends Application { + +- private static Database currentd; + private Album song; + ++ /** ++ * Method which is called when the application is launched ++ * @param primaryStage ++ * @throws Exception ++ */ + @Override + public void start(Stage primaryStage) throws Exception { +- +- deserialize(); +- + Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/MainPage.fxml"))); + primaryStage.setTitle("The Adventurer"); + primaryStage.setScene(new Scene(root, 900, 600)); +@@ -41,39 +42,19 @@ + song.play(); + } + +- ++ /** ++ * Method to stop the music ++ */ + @Override + public void stop(){ +- System.out.println("Stopping"); + song.stop(); + + } + +- +- public static Database getDatabase() { +- return currentd; +- } +- +- public static void serialize() throws IOException { +- try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("database.txt"))) { +- out.writeObject(currentd); +- } finally { +- System.out.println("Saved!"); +- System.exit(0); +- } +- } +- +- public static void deserialize() throws ClassNotFoundException, IOException { +- ObjectInputStream in = null; +- try { +- in = new ObjectInputStream(new FileInputStream("database.txt")); +- currentd = (Database) in.readObject(); +- in.close(); +- } catch (FileNotFoundException | NullPointerException e) { +- currentd = new Database(); +- } +- } +- ++ /** ++ * Constructor of the Main class ++ * @param args ++ */ + public static void main(String[] args) { + launch(args); + } +Index: src/controller/GamePlayController.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package controller;\n\nimport com.jfoenix.controls.JFXButton;\nimport javafx.animation.KeyFrame;\nimport javafx.animation.Timeline;\nimport javafx.fxml.FXML;\nimport javafx.fxml.FXMLLoader;\nimport javafx.fxml.Initializable;\nimport javafx.scene.Scene;\nimport javafx.scene.image.Image;\nimport javafx.scene.image.ImageView;\nimport javafx.scene.layout.AnchorPane;\nimport javafx.scene.paint.Color;\nimport javafx.scene.text.Text;\nimport javafx.stage.Stage;\nimport javafx.util.Duration;\nimport model.Case;\nimport model.GameLoop;\nimport model.GameTime;\nimport model.Map;\nimport model.ResultatTxt;\n\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.ArrayList;\nimport java.util.Objects;\nimport java.util.ResourceBundle;\n\npublic class GamePlayController implements Initializable {\n\n private final int avancementCase = 4;\n private final PersoController persoController = new PersoController();\n private final MapController mapController = new MapController();\n\n @FXML public ImageView persoImageView;\n @FXML public AnchorPane levelRoot;\n @FXML public ImageView de;\n @FXML public ImageView creatureImageView = new ImageView();\n @FXML public ImageView playerImagePerso;\n\n\n private boolean finJeu = false;\n private GameTime gameTime;\n private GameLoop loop;\n private Text textEnd;\n private Text resultat1;\n private Text resultat2;\n private Text resultat3;\n private Text resultat4;\n private Text resultat5;\n private int nbTour = 0;\n\n public int difficulty;\n public int perso;\n private Case caseActuelle, caseAncienne;\n private int i, diceNumber;\n private Thread personnage;\n private String pathPerso;\n private JFXButton button;\n private Boolean PersoMouv;\n\n @FXML\n @Override\n public void initialize(URL url, ResourceBundle resourceBundle) {\n }\n\n public void gameLauncher(){\n levelRoot.getChildren().addAll(mapController.mapInitialisation(this.difficulty), persoController.playerInitialisation(this.difficulty,this.perso, mapController.getMap()), creatureImageView);\n persoController.setActualCase(mapController.getStartCase());\n playerImagePerso.setImage(new Image(\"image/personnage/Perso\" + this.perso + \".2.png\"));\n loop = new GameLoop(this.difficulty, mapController.getMap(), creatureImageView);\n loop.start();\n Text text = new Text();\n text.setText(\"Time : \");\n text.setX(1000);\n text.setY(50);\n text.setFill(Color.WHITE);\n text.setStyle(\"-fx-font: 20 arial;\");\n Text textTimer = new Text();\n textTimer.setText(\"\");\n textTimer.setX(1070);\n textTimer.setY(50);\n textTimer.setFill(Color.WHITE);\n textTimer.setStyle(\"-fx-font: 20 arial;\");\n textEnd = new Text();\n textEnd.setText(\"\");\n textEnd.setX(500);\n textEnd.setY(500);\n textEnd.setFill(Color.WHITE);\n textEnd.setStyle(\"-fx-font: 100 arial; \");\n resultat1 = new Text();\n resultat1.setText(\"\");\n resultat1.setX(1045);\n resultat1.setY(350);\n resultat1.setFill(Color.WHITE);\n resultat1.setStyle(\"-fx-font: 20 arial; \");\n resultat2 = new Text();\n resultat2.setText(\"\");\n resultat2.setX(1045);\n resultat2.setY(400);\n resultat2.setFill(Color.WHITE);\n resultat2.setStyle(\"-fx-font: 20 arial; \");\n resultat3 = new Text();\n resultat3.setText(\"\");\n resultat3.setX(1045);\n resultat3.setY(450);\n resultat3.setFill(Color.WHITE);\n resultat3.setStyle(\"-fx-font: 20 arial; \");\n resultat4 = new Text();\n resultat4.setText(\"\");\n resultat4.setX(1045);\n resultat4.setY(500);\n resultat4.setFill(Color.WHITE);\n resultat4.setStyle(\"-fx-font: 20 arial; \");\n resultat5 = new Text();\n resultat5.setText(\"\");\n resultat5.setX(1045);\n resultat5.setY(550);\n resultat5.setFill(Color.WHITE);\n resultat5.setStyle(\"-fx-font: 20 arial; \");\n button = new JFXButton(\"\");\n levelRoot.getChildren().addAll(text,textTimer,textEnd,button, resultat1, resultat2, resultat3, resultat4, resultat5);\n gameTime = new GameTime(textTimer);\n gameTime.start();\n PersoMouv = false;\n }\n\n public void timer(){\n if(finJeu){\n gameTime.stop();\n loop.stop();\n }\n }\n\n public void movePlayerNextCase() throws InterruptedException {\n\n persoImageView = persoController.persoImageView;\n caseActuelle = persoController.getActualCase();\n pathPerso = persoController.getPath();\n caseAncienne = caseActuelle;\n persoController.setOldCase(caseAncienne);\n caseActuelle = mapController.getNextCase(caseActuelle);\n persoController.setActualCase(caseActuelle);\n Timeline timeline = new Timeline();\n timeline.setCycleCount(1);\n\n int time1 = 100;\n int time2 = 200;\n int time3 = 300;\n int time4 = 400;\n int time5 = 500;\n int time6 = 600;\n int time7 = 700;\n int time8 = 800;\n if(caseActuelle != null){\n //animation déplacement vers la droite\n if (caseActuelle.getCoordX() > caseAncienne.getCoordX()) {\n System.out.println(pathPerso + \"7.png\");\n Image imagePerso7 = new Image(Objects.requireNonNull(getClass().getClassLoader().getResource(pathPerso + \"7.png\")).toExternalForm());\n Image imagePerso8 = new Image(Objects.requireNonNull(getClass().getClassLoader().getResource(pathPerso + \"8.png\")).toExternalForm());\n Image imagePerso9 = new Image(Objects.requireNonNull(getClass().getClassLoader().getResource(pathPerso + \"9.png\")).toExternalForm());\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time1), event -> {\n persoImageView.setImage(imagePerso8);\n persoImageView.setLayoutX(persoImageView.getLayoutX() + avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time2), event -> {\n persoImageView.setImage(imagePerso7);\n persoImageView.setLayoutX(persoImageView.getLayoutX() + avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time3), event -> {\n persoImageView.setImage(imagePerso9);\n persoImageView.setLayoutX(persoImageView.getLayoutX() + avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time4), event -> {\n persoImageView.setImage(imagePerso7);\n persoImageView.setLayoutX(persoImageView.getLayoutX() + avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time5), event -> {\n persoImageView.setImage(imagePerso9);\n persoImageView.setLayoutX(persoImageView.getLayoutX() + avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time6), event -> {\n persoImageView.setImage(imagePerso7);\n persoImageView.setLayoutX(persoImageView.getLayoutX() + avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time7), event -> {\n persoImageView.setImage(imagePerso9);\n persoImageView.setLayoutX(persoImageView.getLayoutX() + avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time8), event -> {\n persoImageView.setImage(imagePerso8);\n persoImageView.setLayoutX(persoImageView.getLayoutX() + avancementCase);\n }));\n timeline.play();\n }\n //animation déplacement vers la gauche\n if (caseActuelle.getCoordX() < caseAncienne.getCoordX()) {\n Image imagePerso4 = new Image(getClass().getClassLoader().getResource(pathPerso + \"4.png\").toExternalForm());\n Image imagePerso5 = new Image(getClass().getClassLoader().getResource(pathPerso + \"5.png\").toExternalForm());\n Image imagePerso6 = new Image(getClass().getClassLoader().getResource(pathPerso + \"6.png\").toExternalForm());\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time1), event -> {\n persoImageView.setImage(imagePerso5);\n persoImageView.setLayoutX(persoImageView.getLayoutX() - avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time2), event -> {\n persoImageView.setImage(imagePerso4);\n persoImageView.setLayoutX(persoImageView.getLayoutX() - avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time3), event -> {\n persoImageView.setImage(imagePerso6);\n persoImageView.setLayoutX(persoImageView.getLayoutX() - avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time4), event -> {\n persoImageView.setImage(imagePerso4);\n persoImageView.setLayoutX(persoImageView.getLayoutX() - avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time5), event -> {\n persoImageView.setImage(imagePerso6);\n persoImageView.setLayoutX(persoImageView.getLayoutX() - avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time6), event -> {\n persoImageView.setImage(imagePerso4);\n persoImageView.setLayoutX(persoImageView.getLayoutX() - avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time7), event -> {\n persoImageView.setImage(imagePerso6);\n persoImageView.setLayoutX(persoImageView.getLayoutX() - avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time8), event -> {\n persoImageView.setImage(imagePerso5);\n persoImageView.setLayoutX(persoImageView.getLayoutX() - avancementCase);\n }));\n timeline.play();\n }\n //animation déplacement vers le haut\n if (caseActuelle.getCoordY() < caseAncienne.getCoordY()) {\n Image imagePerso10 = new Image(getClass().getClassLoader().getResource(pathPerso + \"10.png\").toExternalForm());\n Image imagePerso11 = new Image(getClass().getClassLoader().getResource(pathPerso + \"11.png\").toExternalForm());\n Image imagePerso12 = new Image(getClass().getClassLoader().getResource(pathPerso + \"12.png\").toExternalForm());\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time1), event -> {\n persoImageView.setImage(imagePerso11);\n persoImageView.setLayoutY(persoImageView.getLayoutY() - avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time2), event -> {\n persoImageView.setImage(imagePerso10);\n persoImageView.setLayoutY(persoImageView.getLayoutY() - avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time3), event -> {\n persoImageView.setImage(imagePerso12);\n persoImageView.setLayoutY(persoImageView.getLayoutY() - avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time4), event -> {\n persoImageView.setImage(imagePerso10);\n persoImageView.setLayoutY(persoImageView.getLayoutY() - avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time5), event -> {\n persoImageView.setImage(imagePerso12);\n persoImageView.setLayoutY(persoImageView.getLayoutY() - avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time6), event -> {\n persoImageView.setImage(imagePerso10);\n persoImageView.setLayoutY(persoImageView.getLayoutY() - avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time7), event -> {\n persoImageView.setImage(imagePerso12);\n persoImageView.setLayoutY(persoImageView.getLayoutY() - avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time8), event -> {\n persoImageView.setImage(imagePerso11);\n persoImageView.setLayoutY(persoImageView.getLayoutY() - avancementCase);\n }));\n timeline.play();\n }\n //animation déplacement vers le bas\n if (caseActuelle.getCoordY() > caseAncienne.getCoordY()) {\n Image imagePerso1 = new Image(getClass().getClassLoader().getResource(pathPerso + \"1.png\").toExternalForm());\n Image imagePerso2 = new Image(getClass().getClassLoader().getResource(pathPerso + \"2.png\").toExternalForm());\n Image imagePerso3 = new Image(getClass().getClassLoader().getResource(pathPerso + \"3.png\").toExternalForm());\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time1), event -> {\n persoImageView.setImage(imagePerso2);\n persoImageView.setLayoutY(persoImageView.getLayoutY() + avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time2), event -> {\n persoImageView.setImage(imagePerso1);\n persoImageView.setLayoutY(persoImageView.getLayoutY() + avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time3), event -> {\n persoImageView.setImage(imagePerso3);\n persoImageView.setLayoutY(persoImageView.getLayoutY() + avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time4), event -> {\n persoImageView.setImage(imagePerso1);\n persoImageView.setLayoutY(persoImageView.getLayoutY() + avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time5), event -> {\n persoImageView.setImage(imagePerso3);\n persoImageView.setLayoutY(persoImageView.getLayoutY() + avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(time6), event -> {\n persoImageView.setImage(imagePerso1);\n persoImageView.setLayoutY(persoImageView.getLayoutY() + avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(800), event -> {\n persoImageView.setImage(imagePerso3);\n persoImageView.setLayoutY(persoImageView.getLayoutY() + avancementCase);\n }));\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(900), event -> {\n persoImageView.setImage(imagePerso2);\n persoImageView.setLayoutY(persoImageView.getLayoutY() + avancementCase);\n }));\n timeline.play();\n }\n if(caseActuelle.isEnd()){\n textEnd.setText(\"Fin\");\n finJeu = true;\n timer();\n returnToStart();\n saveScore();\n }\n }else{\n System.out.println(\"Case null\");\n\n }\n }\n\n public void returnToStart(){\n button.setText(\"Restart\");\n button.setStyle(\"-fx-background-color: #EB9C0A; -fx-text-fill: white;\");\n button.setLayoutX(1071);\n button.setLayoutY(752);\n button.setPrefHeight(30);\n button.setPrefWidth(119);\n button.setOnAction(event -> {\n AnchorPane pane = null;\n try {\n pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource(\"/fxml/MainPage.fxml\")));\n Stage a = new Stage();\n a.setTitle(\"The Adventurer\");\n a.setScene(new Scene(pane, 900, 600));\n a.setResizable(false);\n a.show();\n Stage stage = (Stage) levelRoot.getScene().getWindow();\n stage.close();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n levelRoot.getChildren().setAll(pane);\n }\n );\n }\n\n\n public void lancerDe() {\n //Case actual = persoController.getActualCase();\n if(PersoMouv == false) {\n animationDe();\n nbTour++;\n }\n\n //verification(actual);\n }\n\n public void verification(Case actual) {\n Map map = mapController.getMap();\n ArrayList array = map.getMap();\n actual = mapController.getCase(actual, diceNumber);\n for (Case c : array) {\n if (actual.getCoordX() == c.getCoordX() && actual.getCoordY() == c.getCoordY() && c.isBonus()) {\n System.out.println(\"BONUS\");\n System.out.println(\"X perso : \" + actual.getCoordX() + \" Y perso : \" + actual.getCoordY() + \" X perso : \" + c.getCoordX() + \" Y perso : \" + c.getCoordY() + \" Bonus : \" + c.isBonus());\n }\n if (actual.getCoordX() == c.getCoordX() && actual.getCoordY() == c.getCoordY() && c.isMalus()) {\n System.out.println(\"MALUS\");\n }\n }\n }\n\n public void animationDe() {\n personnage = new Thread(\"personnage\") {\n\n public void run() {\n i = 0;\n Timeline timeline = new Timeline();\n timeline.setCycleCount(1);\n\n for (i = 0; i < 10; i++) {\n diceNumber = (int) (Math.random() * 6 + 1);\n String path = \"image/dé/d\" + diceNumber + \".png\";\n timeline.getKeyFrames().add(new KeyFrame(Duration.millis(50 * i), event -> de.setImage(new Image(path))));\n }\n timeline.play();\n try {\n personnage.sleep(700);\n System.out.println(\"Lancement affichage resulsta\");\n affichageResultat();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n for (i = 0; i < diceNumber; i++) {\n try {\n PersoMouv = true;\n movePlayerNextCase();\n sleep(800);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n PersoMouv = false;\n }\n };\n personnage.start();\n }\n public void affichageResultat(){\n System.out.println(\"affichageResultat()\");\n String ancienResultat1;\n String ancienResultat2;\n String ancienResultat3;\n String ancienResultat4;\n String ancienResultat5;\n if(nbTour == 1){\n resultat1.setText(\"Vous avez fait un \" + diceNumber + \".\");\n }else{\n if(nbTour == 2){\n ancienResultat1 = resultat1.getText();\n resultat1.setText(\"Vous avez fait un \" + diceNumber + \".\");\n resultat2.setText(ancienResultat1);\n System.out.println(\"ancienResultat2 : \" + ancienResultat1);\n }else{\n if(nbTour == 3) {\n ancienResultat1 = resultat1.getText();\n ancienResultat2 = resultat2.getText();\n resultat1.setText(\"Vous avez fait un \" + diceNumber + \".\");\n resultat2.setText(ancienResultat1);\n resultat3.setText(ancienResultat2);\n }else{\n if(nbTour == 4){\n ancienResultat1 = resultat1.getText();\n ancienResultat2 = resultat2.getText();\n ancienResultat3 = resultat3.getText();\n resultat1.setText(\"Vous avez fait un \" + diceNumber + \".\");\n resultat2.setText(ancienResultat1);\n resultat3.setText(ancienResultat2);\n resultat4.setText(ancienResultat3);\n }else{\n ancienResultat1 = resultat1.getText();\n ancienResultat2 = resultat2.getText();\n ancienResultat3 = resultat3.getText();\n ancienResultat4 = resultat4.getText();\n resultat1.setText(\"Vous avez fait un \" + diceNumber + \".\");\n resultat2.setText(ancienResultat1);\n resultat3.setText(ancienResultat2);\n resultat4.setText(ancienResultat3);\n resultat5.setText(ancienResultat4);\n }\n }\n\n }\n }\n }\n public void saveScore(){\n //difficulty\n int resultat = gameTime.getTime();\n ResultatTxt resultatTxt = new ResultatTxt();\n resultatTxt.sauvegarderResultat(resultat, difficulty);\n }\n}\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/controller/GamePlayController.java b/src/controller/GamePlayController.java +--- a/src/controller/GamePlayController.java (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) ++++ b/src/controller/GamePlayController.java (date 1642711239134) +@@ -59,12 +59,20 @@ + private JFXButton button; + private Boolean PersoMouv; + ++ /** ++ * Initializes the controller class. ++ * @param url ++ * @param resourceBundle ++ */ + @FXML + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + } + +- public void gameLauncher(){ ++ /** ++ * Method to launch the game ++ */ ++ public void gameLauncher(){ + levelRoot.getChildren().addAll(mapController.mapInitialisation(this.difficulty), persoController.playerInitialisation(this.difficulty,this.perso, mapController.getMap()), creatureImageView); + persoController.setActualCase(mapController.getStartCase()); + playerImagePerso.setImage(new Image("image/personnage/Perso" + this.perso + ".2.png")); +@@ -125,13 +133,20 @@ + PersoMouv = false; + } + +- public void timer(){ ++ /** ++ * Method to stop the gameTime and the gameLoop ++ */ ++ public void timer(){ + if(finJeu){ + gameTime.stop(); + loop.stop(); + } + } + ++ /** ++ * Method to move the player to the next case ++ * @throws InterruptedException ++ */ + public void movePlayerNextCase() throws InterruptedException { + + persoImageView = persoController.persoImageView; +@@ -323,6 +338,9 @@ + } + } + ++ /** ++ * Method to return to the start of the game ++ */ + public void returnToStart(){ + button.setText("Restart"); + button.setStyle("-fx-background-color: #EB9C0A; -fx-text-fill: white;"); +@@ -350,7 +368,9 @@ + ); + } + +- ++ /** ++ * Method to lunch the dice ++ */ + public void lancerDe() { + //Case actual = persoController.getActualCase(); + if(PersoMouv == false) { +@@ -361,6 +381,10 @@ + //verification(actual); + } + ++ /** ++ * Method to verify if the case is a bonus or a malus ++ * @param actual ++ */ + public void verification(Case actual) { + Map map = mapController.getMap(); + ArrayList array = map.getMap(); +@@ -376,6 +400,9 @@ + } + } + ++ /** ++ * Method to launch the animation of the dice ++ */ + public void animationDe() { + personnage = new Thread("personnage") { + +@@ -411,6 +438,10 @@ + }; + personnage.start(); + } ++ ++ /** ++ * Method to display the result of the dice ++ */ + public void affichageResultat(){ + System.out.println("affichageResultat()"); + String ancienResultat1; +@@ -458,6 +489,10 @@ + } + } + } ++ ++ /** ++ * Method to save the score of the player ++ */ + public void saveScore(){ + //difficulty + int resultat = gameTime.getTime(); +Index: src/model/Time.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package model;\n\npublic class Time {\n private Thread timer;\n\n public void start() {\n timer = new Thread(\"timer\") {\n public void run() {\n int nbMinutes = 1;\n int i = 0;\n while(true) {\n if(i == 0) {\n //action\n System.out.println(\"Timer = \" + i);\n i = 60 * nbMinutes;\n }else{\n System.out.println(\"Timer = \" + i);\n i--;\n try {\n timer.sleep(1000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n\n }\n }\n\n\n };\n }\n\n}\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/model/Time.java b/src/model/Time.java +--- a/src/model/Time.java (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) ++++ b/src/model/Time.java (date 1642710300624) +@@ -3,6 +3,9 @@ + public class Time { + private Thread timer; + ++ /** ++ * Method to start the timer ++ */ + public void start() { + timer = new Thread("timer") { + public void run() { +Index: src/controller/CreatureController.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package controller;\n\nimport javafx.animation.KeyFrame;\nimport javafx.animation.Timeline;\nimport javafx.fxml.FXML;\nimport javafx.scene.image.Image;\nimport javafx.scene.image.ImageView;\nimport javafx.scene.layout.AnchorPane;\nimport javafx.util.Duration;\nimport model.Case;\nimport model.Creature;\nimport model.Map;\n\nimport java.util.ArrayList;\nimport java.util.Objects;\nimport java.util.concurrent.TimeUnit;\n\npublic class CreatureController {\n private int lv;\n //private final Image dog1 = new Image(\"/image/creature/dog1.2.png\");\n private Creature creature;\n @FXML public ImageView creatureImageView;\n @FXML public AnchorPane levelRoot;\n private Map map;\n private MapCreatureController mapCreatureController;\n private Case caseCreatureStart;\n private Thread Creature;\n private String imagePath;\n private Case caseActuelle;\n private Case caseAncienne;\n private Image imagePerso1;\n private Image imagePerso2;\n private Image imagePerso3;\n private Image imagePerso4;\n private Image imagePerso5;\n private Image imagePerso6;\n private Image imagePerso7;\n private Image imagePerso8;\n private Image imagePerso9;\n private Image imagePerso10;\n private Image imagePerso11;\n private Image imagePerso12;\n\n public CreatureController(int lv,Map map, ImageView creatureImageView) {\n this.lv = lv;\n this.map = map;\n this.creatureImageView = creatureImageView;\n }\n public void createCreature(int animal) {\n if(animal == 1) {\n this.creature = new Creature(1,\"/image/creature/dog1.\",0,0 );\n //creatureImageView.setImage(dog1);\n }\n if(animal == 2) {\n this.creature = new Creature(2,\"/image/creature/bear1.\",0,0 );\n }\n if(animal == 3) {\n this.creature = new Creature(2,\"/image/creature/goat1.\",0,0 );\n }\n }\n\n public void playerInitialisation() throws InterruptedException {\n mapCreatureController = new MapCreatureController(lv, map);\n mapCreatureController.creerMapCreature();\n int max = 3;\n int min = 1;\n double a = Math.random() * ( max - min );\n int numCreature = (int) Math.round(a) + min;\n createCreature(numCreature);\n\n caseCreatureStart = mapCreatureController.getStartCase();\n creature.setCoordX(caseCreatureStart.getCoordX());\n creature.setCoordY(caseCreatureStart.getCoordY());\n caseActuelle = caseCreatureStart;\n\n imagePath = getPath();\n String pathStart = imagePath + \"2.png\";\n creatureImageView.setImage(new Image(pathStart));\n creatureImageView.setId(\"creatureImageView\");\n creatureImageView.setFitWidth(35);\n creatureImageView.setFitHeight(35);\n creatureImageView.setLayoutX(getX()*map.getSizeTile()-5);\n creatureImageView.setLayoutY(getY()*map.getSizeTile()-5);\n //levelRoot.getChildren().addAll(creatureImageView);\n\n Creature = new Thread(\"Creature\") {\n public void run() {\n for (int i = 0; i < mapCreatureController.getSizeListeCase()-1; i++) {\n try {\n movePlayerNextCase();\n Creature.sleep(800);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n if(i>=mapCreatureController.getSizeListeCase()-2) {\n creatureImageView.setImage(new Image(\"/image/creature/void.png\"));\n System.out.println(\"FIN 1\");\n }\n }\n System.out.println(\"FIN 2\");\n creatureImageView.setImage(new Image(\"/image/creature/void.png\"));\n }\n };\n Creature.start();\n\n\n }\n\n public void movePlayerNextCase() throws InterruptedException {\n caseAncienne = caseActuelle;\n caseActuelle = mapCreatureController.getNextCase(caseActuelle);\n Timeline timelines = new Timeline();\n timelines.setCycleCount(1);\n int time1 = 100;\n int time2 = 200;\n int time3 = 300;\n int time4 = 400;\n int time5 = 500;\n int time6 = 600;\n int time7 = 700;\n int time8 = 800;\n int avancementCase = 4;\n int tempsattente = 00;\n //animation déplacement vers la droite\n if(caseActuelle.getCoordX() > caseAncienne.getCoordX()){\n imagePerso7 = new Image(imagePath + \"7.png\");\n imagePerso8 = new Image(imagePath + \"8.png\");\n imagePerso9 = new Image(imagePath + \"9.png\");\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time1), event -> {\n creatureImageView.setImage(imagePerso8);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()+avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time2), event -> {\n creatureImageView.setImage(imagePerso7);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()+avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time3), event -> {\n creatureImageView.setImage(imagePerso9);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()+avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time4), event -> {\n creatureImageView.setImage(imagePerso7);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()+avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time5), event -> {\n creatureImageView.setImage(imagePerso9);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()+avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time6), event -> {\n creatureImageView.setImage(imagePerso7);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()+avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time7), event -> {\n creatureImageView.setImage(imagePerso9);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()+avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time8), event -> {\n creatureImageView.setImage(imagePerso8);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()+avancementCase);\n }));\n timelines.play();\n }\n //animation déplacement vers la gauche\n if(caseActuelle.getCoordX() < caseAncienne.getCoordX()){\n imagePerso4 = new Image(imagePath + \"4.png\");\n imagePerso5 = new Image(imagePath + \"5.png\");\n imagePerso6 = new Image(imagePath + \"6.png\");\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time1), event -> {\n creatureImageView.setImage(imagePerso5);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()-avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time2), event -> {\n creatureImageView.setImage(imagePerso4);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()-avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time3), event -> {\n creatureImageView.setImage(imagePerso6);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()-avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time4), event -> {\n creatureImageView.setImage(imagePerso4);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()-avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time5), event -> {\n creatureImageView.setImage(imagePerso6);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()-avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time6), event -> {\n creatureImageView.setImage(imagePerso4);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()-avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time7), event -> {\n creatureImageView.setImage(imagePerso6);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()-avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time8), event -> {\n creatureImageView.setImage(imagePerso5);\n creatureImageView.setLayoutX(creatureImageView.getLayoutX()-avancementCase);\n }));\n timelines.play();\n }\n //animation déplacement vers le haut\n if(caseActuelle.getCoordY() < caseAncienne.getCoordY()){\n imagePerso10 = new Image(imagePath + \"10.png\");\n imagePerso11 = new Image(imagePath + \"11.png\");\n imagePerso12 = new Image(imagePath + \"12.png\");\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time1), event -> {\n creatureImageView.setImage(imagePerso11);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()-avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time2), event -> {\n creatureImageView.setImage(imagePerso10);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()-avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time3), event -> {\n creatureImageView.setImage(imagePerso12);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()-avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time4), event -> {\n creatureImageView.setImage(imagePerso10);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()-avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time5), event -> {\n creatureImageView.setImage(imagePerso12);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()-avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time6), event -> {\n creatureImageView.setImage(imagePerso10);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()-avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time7), event -> {\n creatureImageView.setImage(imagePerso12);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()-avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time8), event -> {\n creatureImageView.setImage(imagePerso11);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()-avancementCase);\n }));\n timelines.play();\n }\n //animation déplacement vers le bas\n if(caseActuelle.getCoordY() > caseAncienne.getCoordY()){\n imagePerso1 = new Image(imagePath + \"1.png\");\n imagePerso2 = new Image(imagePath + \"2.png\");\n imagePerso3 = new Image(imagePath + \"3.png\");\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time1), event -> {\n creatureImageView.setImage(imagePerso2);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()+avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time2), event -> {\n creatureImageView.setImage(imagePerso1);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()+avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time3), event -> {\n creatureImageView.setImage(imagePerso3);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()+avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time4), event -> {\n creatureImageView.setImage(imagePerso1);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()+avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time5), event -> {\n creatureImageView.setImage(imagePerso3);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()+avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time6), event -> {\n creatureImageView.setImage(imagePerso1);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()+avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time7), event -> {\n creatureImageView.setImage(imagePerso3);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()+avancementCase);\n }));\n timelines.getKeyFrames().add(new KeyFrame(Duration.millis(time8), event -> {\n creatureImageView.setImage(imagePerso2);\n creatureImageView.setLayoutY(creatureImageView.getLayoutY()+avancementCase);\n }));\n timelines.play();\n }\n }\n public String getPath(){\n return creature.getImage();\n }\n public int getX(){\n return creature.getCoordX();\n\n }\n\n public int getY(){\n return creature.getCoordY();\n }\n}\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/controller/CreatureController.java b/src/controller/CreatureController.java +--- a/src/controller/CreatureController.java (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) ++++ b/src/controller/CreatureController.java (date 1642710675726) +@@ -41,11 +41,22 @@ + private Image imagePerso11; + private Image imagePerso12; + ++ /** ++ * Constructor of the CreatureController class ++ * @param lv ++ * @param map ++ * @param creatureImageView ++ */ + public CreatureController(int lv,Map map, ImageView creatureImageView) { + this.lv = lv; + this.map = map; + this.creatureImageView = creatureImageView; + } ++ ++ /** ++ * Method to create a creature ++ * @param animal ++ */ + public void createCreature(int animal) { + if(animal == 1) { + this.creature = new Creature(1,"/image/creature/dog1.",0,0 ); +@@ -59,6 +70,10 @@ + } + } + ++ /** ++ * Method to initialize the creature ++ * @throws InterruptedException ++ */ + public void playerInitialisation() throws InterruptedException { + mapCreatureController = new MapCreatureController(lv, map); + mapCreatureController.creerMapCreature(); +@@ -106,6 +121,10 @@ + + } + ++ /** ++ * Method to move the creature to the next case ++ * @throws InterruptedException ++ */ + public void movePlayerNextCase() throws InterruptedException { + caseAncienne = caseActuelle; + caseActuelle = mapCreatureController.getNextCase(caseActuelle); +@@ -278,14 +297,28 @@ + timelines.play(); + } + } ++ ++ /** ++ * Method to get the path of the image of the creature ++ * @return the path of the image of the creature ++ */ + public String getPath(){ + return creature.getImage(); + } ++ ++ /** ++ * Method to get the X coordinate of the creature ++ * @return X coordinate ++ */ + public int getX(){ + return creature.getCoordX(); + + } + ++ /** ++ * Method to get the Y coordinate of the creature ++ * @return Y coordinate ++ */ + public int getY(){ + return creature.getCoordY(); + } +Index: src/controller/MapCreatureController.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package controller;\n\nimport model.Case;\nimport model.Map;\nimport model.MapCreature;\n\npublic class MapCreatureController {\n private int lv;\n private MapCreature mapCreature;\n private Map map;\n private int[][] coordList;\n public MapCreatureController(int lv, Map map) {\n this.lv = lv;\n this.map = map;\n }\n public void creerMapCreature() {\n int[][] coord1Lv1 = {{0,-1},{0,0},{1,0},{2,0},{3,0},{3,1},{4,1},{5,1},{6,1},{7,1},{8,1},{9,1},{9,2},{10,2},{11,2},{12,2},{13,2},{14,2},{15,2},{16,2},{17,2},{18,2},{19,2},{20,2},{21,2},{21,3},{21,4},{22,4},{23,4},{24,4},{25,4},{25,5},{25,6},{26,6},{27,6},{28,6},{28,7},{28,8},{28,9},{28,10},{28,11},{28,12},{29,12},{30,12}};\n int[][] coord2Lv1 = {{30,27},{29,27},{28,27},{27,27},{26,27},{25,27},{24,27},{23,27},{23,26},{22,26},{21,26},{20,26},{20,25},{19,25},{18,25},{17,25},{16,25},{15,25},{14,25},{13,25},{13,24},{12,24},{11,24},{10,24},{9,24},{8,24},{7,24},{6,24},{6,25},{6,26},{5,26},{4,26},{3,26},{2,26},{1,26},{-1,26},{-2,26}};\n int[][] coord1Lv2 = {{0,-1},{0,0},{0,1},{0,2},{1,2},{2,2},{3,2},{3,3},{3,4},{3,5},{4,5},{5,5},{6,5},{7,5},{8,5},{8,6},{9,6},{9,7},{9,8},{10,8},{11,8},{12,8},{12,9},{13,9},{14,9},{15,9},{16,9},{17,9},{18,9},{18,10},{19,10},{20,10},{20,9},{21,9},{21,8},{21,7},{20,7},{20,6},{19,6},{18,6},{18,7},{17,7},{16,7},{15,7},{14,7},{14,6},{14,5},{14,4},{15,4},{15,3},{15,2},{14,2},{14,1},{14,0},{14,-1},{14,-2}};\n int[][] coord2Lv2 = {{30,22},{29,22},{28,22},{27,22},{26,22},{25,22},{24,22},{24,21},{23,21},{22,21},{22,20},{21,20},{20,20},{19,20},{18,20},{17,20},{17,19},{16,19},{15,19},{14,19},{14,18},{13,18},{13,17},{13,16},{14,16},{15,16},{16,16},{17,16},{17,17},{18,17},{19,17},{20,17},{21,17},{21,16},{21,15},{22,15},{23,15},{24,15},{25,15},{26,15},{26,14},{27,14},{28,14},{28,13},{28,12},{29,12},{30,12}};\n int[][] coord1Lv3 = {{30,4},{29,4},{28,4},{27,4},{26,4},{25,4},{24,4},{23,4},{23,5},{23,6},{23,7},{22,7},{21,7},{20,7},{20,6},{19,6},{19,5},{19,4},{18,4},{17,4},{17,5},{17,6},{17,7},{18,7},{18,8},{19,8},{20,8},{21,8},{22,8},{23,8},{24,8},{24,9},{25,9},{26,9},{27,9},{28,9},{29,9},{30,9}};\n int[][] coord2Lv3 = {{-1,7},{0,7},{1,7},{2,7},{2,8},{3,8},{4,8},{4,9},{5,9},{6,9},{7,9},{8,9},{9,9},{9,10},{10,10},{11,10},{12,10},{13,10},{14,10},{14,11},{14,12},{15,12},{15,13},{14,13},{13,13},{12,13},{11,13},{11,12},{11,11},{11,10},{10,10},{9,10},{8,10},{8,11},{7,11},{7,12},{7,13},{6,13},{5,13},{4,13},{4,12},{4,11},{4,10},{3,10},{2,10},{1,10},{0,10},{-1,10}};\n //int[][] coordLv1 = {{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0},{9,0}};\n //int[][] coordLv1 = {{0,24},{1,24},{2,24},{3,24},{4,24},{5,24},{5,23},{5,22},{5,21},{5,20},{5,19},{5,18},{6,18},{7,18},{8,18},{9,18},{10,18},{11,18},{12,18},{12,17},{12,16},{12,15},{12,14},{12,13},{12,12},{11,12},{10,12},{9,12},{8,12},{7,12},{6,12},{5,12},{4,12},{3,12},{3,11},{3,10},{3,9},{3,8},{3,7},{3,6},{3,5},{3,4},{3,3},{4,3},{5,3},{6,3},{7,3},{8,3},{9,3},{10,3},{11,3},{12,3},{13,3},{14,3},{15,3},{16,3},{17,3},{18,3},{19,3},{19,4},{19,5},{19,6},{19,7},{19,8},{19,9},{19,10},{20,10},{21,10},{22,10},{23,10},{24,10},{24,11},{24,12},{24,13},{24,14},{24,15},{24,16},{24,17},{24,18},{24,19},{24,20},{24,21},{24,22},{24,23},{24,24},{25,24},{26,24},{27,24},{28,24},{29,24}};\n\n\n mapCreature = new MapCreature(map.getSizeTile(), map.getSizeMap());\n\n int max = 2;\n int min = 1;\n double a = Math.random() * ( max - min );\n int numCreature = (int) Math.round(a) + min;\n int j = 1;\n if(lv == 1) {\n if(numCreature == 1) {\n coordList = coord1Lv1;\n }\n if (numCreature == 2) {\n coordList = coord2Lv1;\n }\n for(int[] i : coordList){\n boolean bool = j == 1;\n Case case1 = new Case(j, i[0], i [1], bool,false,false, false, map);\n mapCreature.addCase(case1);\n j++;\n }\n }\n if(lv == 2) {\n if(numCreature == 1) {\n coordList = coord1Lv2;\n }\n if (numCreature == 2) {\n coordList = coord2Lv2;\n }\n for(int[] i : coordList){\n boolean bool = j == 1;\n Case case1 = new Case(j, i[0], i [1], bool,false,false, false, map);\n mapCreature.addCase(case1);\n j++;\n }\n }\n if(lv == 3) {\n if(numCreature == 1) {\n coordList = coord1Lv3;\n }\n if (numCreature == 2) {\n coordList = coord2Lv3;\n }\n for(int[] i : coordList){\n boolean bool = j == 1;\n Case case1 = new Case(j, i[0], i [1], bool,false,false, false, map);\n mapCreature.addCase(case1);\n j++;\n }\n }\n }\n public MapCreature getMap(){\n return this.mapCreature;\n }\n\n public Case getNextCase(Case c){\n return mapCreature.getNextCase(c);\n }\n\n public Case getStartCase(){\n return mapCreature.getStartCase();\n }\n\n public int getSizeListeCase(){\n return coordList.length;\n }\n}\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/controller/MapCreatureController.java b/src/controller/MapCreatureController.java +--- a/src/controller/MapCreatureController.java (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) ++++ b/src/controller/MapCreatureController.java (date 1642712082608) +@@ -9,10 +9,20 @@ + private MapCreature mapCreature; + private Map map; + private int[][] coordList; ++ ++ /** ++ * Constructor of MapCreatureController class ++ * @param lv ++ * @param map ++ */ + public MapCreatureController(int lv, Map map) { + this.lv = lv; + this.map = map; + } ++ ++ /** ++ * Method to create a MapCreature ++ */ + public void creerMapCreature() { + int[][] coord1Lv1 = {{0,-1},{0,0},{1,0},{2,0},{3,0},{3,1},{4,1},{5,1},{6,1},{7,1},{8,1},{9,1},{9,2},{10,2},{11,2},{12,2},{13,2},{14,2},{15,2},{16,2},{17,2},{18,2},{19,2},{20,2},{21,2},{21,3},{21,4},{22,4},{23,4},{24,4},{25,4},{25,5},{25,6},{26,6},{27,6},{28,6},{28,7},{28,8},{28,9},{28,10},{28,11},{28,12},{29,12},{30,12}}; + int[][] coord2Lv1 = {{30,27},{29,27},{28,27},{27,27},{26,27},{25,27},{24,27},{23,27},{23,26},{22,26},{21,26},{20,26},{20,25},{19,25},{18,25},{17,25},{16,25},{15,25},{14,25},{13,25},{13,24},{12,24},{11,24},{10,24},{9,24},{8,24},{7,24},{6,24},{6,25},{6,26},{5,26},{4,26},{3,26},{2,26},{1,26},{-1,26},{-2,26}}; +@@ -20,9 +30,6 @@ + int[][] coord2Lv2 = {{30,22},{29,22},{28,22},{27,22},{26,22},{25,22},{24,22},{24,21},{23,21},{22,21},{22,20},{21,20},{20,20},{19,20},{18,20},{17,20},{17,19},{16,19},{15,19},{14,19},{14,18},{13,18},{13,17},{13,16},{14,16},{15,16},{16,16},{17,16},{17,17},{18,17},{19,17},{20,17},{21,17},{21,16},{21,15},{22,15},{23,15},{24,15},{25,15},{26,15},{26,14},{27,14},{28,14},{28,13},{28,12},{29,12},{30,12}}; + int[][] coord1Lv3 = {{30,4},{29,4},{28,4},{27,4},{26,4},{25,4},{24,4},{23,4},{23,5},{23,6},{23,7},{22,7},{21,7},{20,7},{20,6},{19,6},{19,5},{19,4},{18,4},{17,4},{17,5},{17,6},{17,7},{18,7},{18,8},{19,8},{20,8},{21,8},{22,8},{23,8},{24,8},{24,9},{25,9},{26,9},{27,9},{28,9},{29,9},{30,9}}; + int[][] coord2Lv3 = {{-1,7},{0,7},{1,7},{2,7},{2,8},{3,8},{4,8},{4,9},{5,9},{6,9},{7,9},{8,9},{9,9},{9,10},{10,10},{11,10},{12,10},{13,10},{14,10},{14,11},{14,12},{15,12},{15,13},{14,13},{13,13},{12,13},{11,13},{11,12},{11,11},{11,10},{10,10},{9,10},{8,10},{8,11},{7,11},{7,12},{7,13},{6,13},{5,13},{4,13},{4,12},{4,11},{4,10},{3,10},{2,10},{1,10},{0,10},{-1,10}}; +- //int[][] coordLv1 = {{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0},{9,0}}; +- //int[][] coordLv1 = {{0,24},{1,24},{2,24},{3,24},{4,24},{5,24},{5,23},{5,22},{5,21},{5,20},{5,19},{5,18},{6,18},{7,18},{8,18},{9,18},{10,18},{11,18},{12,18},{12,17},{12,16},{12,15},{12,14},{12,13},{12,12},{11,12},{10,12},{9,12},{8,12},{7,12},{6,12},{5,12},{4,12},{3,12},{3,11},{3,10},{3,9},{3,8},{3,7},{3,6},{3,5},{3,4},{3,3},{4,3},{5,3},{6,3},{7,3},{8,3},{9,3},{10,3},{11,3},{12,3},{13,3},{14,3},{15,3},{16,3},{17,3},{18,3},{19,3},{19,4},{19,5},{19,6},{19,7},{19,8},{19,9},{19,10},{20,10},{21,10},{22,10},{23,10},{24,10},{24,11},{24,12},{24,13},{24,14},{24,15},{24,16},{24,17},{24,18},{24,19},{24,20},{24,21},{24,22},{24,23},{24,24},{25,24},{26,24},{27,24},{28,24},{29,24}}; +- + + mapCreature = new MapCreature(map.getSizeTile(), map.getSizeMap()); + +@@ -74,18 +81,36 @@ + } + } + } ++ ++ /** ++ * Method to get the map ++ * @return creature's map ++ */ + public MapCreature getMap(){ + return this.mapCreature; + } + ++ /** ++ * Method to get the next case ++ * @param c ++ * @return case ++ */ + public Case getNextCase(Case c){ + return mapCreature.getNextCase(c); + } + ++ /** ++ * Method to get the start case ++ * @return case ++ */ + public Case getStartCase(){ + return mapCreature.getStartCase(); + } + ++ /** ++ * Method to get the size of ListeCase ++ * @return size of ListeCase ++ */ + public int getSizeListeCase(){ + return coordList.length; + } +Index: src/controller/TopPlayerController.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package controller;\n\nimport javafx.fxml.FXML;\nimport javafx.fxml.FXMLLoader;\nimport javafx.fxml.Initializable;\nimport javafx.scene.control.Button;\nimport javafx.scene.input.MouseEvent;\nimport javafx.scene.layout.AnchorPane;\nimport javafx.scene.paint.Color;\nimport javafx.scene.text.Text;\nimport model.ListeScore;\nimport model.ResultatTxt;\nimport model.Score;\n\nimport java.net.URL;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.ArrayList;\nimport java.util.Objects;\nimport java.util.ResourceBundle;\n\npublic class TopPlayerController implements Initializable {\n\n @FXML\n private AnchorPane levelRoot;\n\n @FXML\n private Button returnToMenu;\n private Text resultat1;\n private Text resultat2;\n private Text resultat3;\n private Text resultat4;\n private Text resultat5;\n private Text resultat6;\n private Text resultat7;\n private Text resultat8;\n private Text resultat9;\n private Text resultat10;\n\n @Override\n public void initialize(URL url, ResourceBundle resourceBundle) {\n initialisationTexte();\n afficherRésultat();\n }\n public void initialisationTexte(){\n resultat1 = new Text();\n resultat1.setText(\"\");\n resultat1.setX(300);\n resultat1.setY(210);\n resultat1.setFill(Color.WHITE);\n resultat1.setStyle(\"-fx-font: 20 Arial; -fx-alignment: CENTER;\");\n resultat2 = new Text();\n resultat2.setText(\"\");\n resultat2.setX(300);\n resultat2.setY(240);\n resultat2.setFill(Color.WHITE);\n resultat2.setStyle(\"-fx-font: 20 Arial; -fx-alignment: CENTER;\");\n resultat3 = new Text();\n resultat3.setText(\"\");\n resultat3.setX(300);\n resultat3.setY(270);\n resultat3.setFill(Color.WHITE);\n resultat3.setStyle(\"-fx-font: 20 Arial; -fx-alignment: CENTER;\");\n resultat4 = new Text();\n resultat4.setText(\"\");\n resultat4.setX(300);\n resultat4.setY(300);\n resultat4.setFill(Color.WHITE);\n resultat4.setStyle(\"-fx-font: 20 Arial; -fx-alignment: CENTER;\");\n resultat5 = new Text();\n resultat5.setText(\"\");\n resultat5.setX(300);\n resultat5.setY(330);\n resultat5.setFill(Color.WHITE);\n resultat5.setStyle(\"-fx-font: 20 Arial; -fx-alignment: CENTER;\");\n resultat6 = new Text();\n resultat6.setText(\"\");\n resultat6.setX(300);\n resultat6.setY(360);\n resultat6.setFill(Color.WHITE);\n resultat6.setStyle(\"-fx-font: 20 Arial; -fx-alignment: CENTER;\");\n resultat7 = new Text();\n resultat7.setText(\"\");\n resultat7.setX(300);\n resultat7.setY(390);\n resultat7.setFill(Color.WHITE);\n resultat7.setStyle(\"-fx-font: 20 Arial; -fx-alignment: CENTER;\");\n resultat8 = new Text();\n resultat8.setText(\"\");\n resultat8.setX(300);\n resultat8.setY(420);\n resultat8.setFill(Color.WHITE);\n resultat8.setStyle(\"-fx-font: 20 Arial; -fx-alignment: CENTER;\");\n resultat9 = new Text();\n resultat9.setText(\"\");\n resultat9.setX(300);\n resultat9.setY(450);\n resultat9.setFill(Color.WHITE);\n resultat9.setStyle(\"-fx-font: 20 Arial; -fx-alignment: CENTER;\");\n resultat10 = new Text();\n resultat10.setText(\"\");\n resultat10.setX(300);\n resultat10.setY(480);\n resultat10.setFill(Color.WHITE);\n resultat10.setStyle(\"-fx-font: 20 Arial; -fx-alignment: CENTER;\");\n\n\n levelRoot.getChildren().addAll(resultat1,resultat2,resultat3,resultat4,resultat5,resultat6,resultat7,resultat8,resultat9,resultat10);\n }\n\n public void afficherRésultat(){\n ResultatTxt resultatTxt = new ResultatTxt();\n ListeScore listeScore = new ListeScore();\n ArrayList liste = new ArrayList<>();\n listeScore = resultatTxt.chargerResultat();\n liste = listeScore.getListeScore();\n int meilleur1 = 0;\n int meilleur2 = 0;\n int meilleur3 = 0;\n int meilleur4 = 0;\n int meilleur5 = 0;\n int meilleur6 = 0;\n int meilleur7 = 0;\n int meilleur8 = 0;\n int meilleur9 = 0;\n int meilleur10 = 0;\n String valeur1 = \"\";\n String valeur2 = \"\";\n String valeur3 = \"\";\n String valeur4 = \"\";\n String valeur5 = \"\";\n String valeur6 = \"\";\n String valeur7 = \"\";\n String valeur8 = \"\";\n String valeur9 = \"\";\n String valeur10 = \"\";\n\n //make a hashmap\n HashMap map = new HashMap<>();\n String value = \"\";\n int i = 0;\n\n for (Score score : liste) {\n value = \"Lvl : \" + score.getLevel() + \" Date : \" + score.getDate();\n map.put(score.getScore(), value);\n //System.out.println(score.getScore() + \" \" + score.getLevel() + \" \" + score.getDate());\n }\n for(Map.Entry entry : map.entrySet()){\n Integer key = entry.getKey();\n String valeur = entry.getValue();\n\n System.out.println(i + \" \" + key + \" \" + valeur);\n switch (i){\n case 0:\n meilleur1 = key;\n valeur1 = valeur;\n break;\n case 1:\n meilleur2 = key;\n valeur2 = valeur;\n break;\n case 2:\n meilleur3 = key;\n valeur3 = valeur;\n break;\n case 3:\n meilleur4 = key;\n valeur4 = valeur;\n break;\n case 4:\n meilleur5 = key;\n valeur5 = valeur;\n break;\n case 5:\n meilleur6 = key;\n valeur6 = valeur;\n break;\n case 6:\n meilleur7 = key;\n valeur7 = valeur;\n break;\n case 7:\n meilleur8 = key;\n valeur8 = valeur;\n break;\n case 8:\n meilleur9 = key;\n valeur9 = valeur;\n break;\n case 9:\n meilleur10 = key;\n valeur10 = valeur;\n break;\n }\n if(key >= meilleur1){\n System.out.println(key + \" : key >= meilleur1\");\n meilleur10 = meilleur9;\n valeur10 = valeur9;\n meilleur9 = meilleur8;\n valeur9 = valeur8;\n meilleur8 = meilleur7;\n valeur8 = valeur7;\n meilleur7 = meilleur6;\n valeur7 = valeur6;\n meilleur6 = meilleur5;\n valeur6 = valeur5;\n meilleur5 = meilleur4;\n valeur5 = valeur4;\n meilleur4 = meilleur3;\n valeur4 = valeur3;\n meilleur3 = meilleur2;\n valeur3 = valeur2;\n meilleur2 = meilleur1;\n valeur2 = valeur1;\n meilleur1 = key;\n valeur1 = valeur;\n }else{\n if(key >= meilleur2){\n System.out.println(key + \" : key >= meilleur2\");\n meilleur10 = meilleur9;\n valeur10 = valeur9;\n meilleur9 = meilleur8;\n valeur9 = valeur8;\n meilleur8 = meilleur7;\n valeur8 = valeur7;\n meilleur7 = meilleur6;\n valeur7 = valeur6;\n meilleur6 = meilleur5;\n valeur6 = valeur5;\n meilleur5 = meilleur4;\n valeur5 = valeur4;\n meilleur4 = meilleur3;\n valeur4 = valeur3;\n meilleur3 = meilleur2;\n valeur3 = valeur2;\n meilleur2 = key;\n valeur2 = valeur;\n }else{\n if(key >= meilleur3){\n System.out.println(key + \" : key >= meilleur3\");\n meilleur10 = meilleur9;\n valeur10 = valeur9;\n meilleur9 = meilleur8;\n valeur9 = valeur8;\n meilleur8 = meilleur7;\n valeur8 = valeur7;\n meilleur7 = meilleur6;\n valeur7 = valeur6;\n meilleur6 = meilleur5;\n valeur6 = valeur5;\n meilleur5 = meilleur4;\n valeur5 = valeur4;\n meilleur4 = meilleur3;\n valeur4 = valeur3;\n meilleur3 = key;\n valeur3 = valeur;\n }else{\n if(key >= meilleur4){\n System.out.println(key + \" : key >= meilleur4\");\n meilleur10 = meilleur9;\n valeur10 = valeur9;\n meilleur9 = meilleur8;\n valeur9 = valeur8;\n meilleur8 = meilleur7;\n valeur8 = valeur7;\n meilleur7 = meilleur6;\n valeur7 = valeur6;\n meilleur6 = meilleur5;\n valeur6 = valeur5;\n meilleur5 = meilleur4;\n valeur5 = valeur4;\n meilleur4 = key;\n valeur4 = valeur;\n }else{\n if(key >= meilleur5){\n System.out.println(key + \" : key >= meilleur5\");\n meilleur10 = meilleur9;\n valeur10 = valeur9;\n meilleur9 = meilleur8;\n valeur9 = valeur8;\n meilleur8 = meilleur7;\n valeur8 = valeur7;\n meilleur7 = meilleur6;\n valeur7 = valeur6;\n meilleur6 = meilleur5;\n valeur6 = valeur5;\n meilleur5 = key;\n valeur5 = valeur;\n }else{\n if(key >= meilleur6){\n System.out.println(key + \" : key >= meilleur6\");\n meilleur10 = meilleur9;\n valeur10 = valeur9;\n meilleur9 = meilleur8;\n valeur9 = valeur8;\n meilleur8 = meilleur7;\n valeur8 = valeur7;\n meilleur7 = meilleur6;\n valeur7 = valeur6;\n meilleur6 = key;\n valeur6 = valeur;\n }else{\n if(key >= meilleur7){\n System.out.println(key + \" : key >= meilleur7\");\n meilleur10 = meilleur9;\n valeur10 = valeur9;\n meilleur9 = meilleur8;\n valeur9 = valeur8;\n meilleur8 = meilleur7;\n valeur8 = valeur7;\n meilleur7 = key;\n valeur7 = valeur;\n }else{\n if(key >= meilleur8){\n System.out.println(key + \" : key >= meilleur8\");\n meilleur10 = meilleur9;\n valeur10 = valeur9;\n meilleur9 = meilleur8;\n valeur9 = valeur8;\n meilleur8 = key;\n valeur8 = valeur;\n }else{\n if(key >= meilleur9){\n System.out.println(key + \" : key >= meilleur9\");\n meilleur10 = meilleur9;\n valeur10 = valeur9;\n meilleur9 = key;\n valeur9 = valeur;\n }else{\n if(key >= meilleur10){\n System.out.println(key + \" : key >= meilleur10\");\n meilleur10 = key;\n valeur10 = valeur;\n\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n i++;\n }\n if (meilleur10 != 0 && i>=10) {\n resultat10.setText(\"Temps : \" + meilleur10 + \" \" + valeur10);\n }\n if (meilleur9 != 0 && i>=9) {\n resultat9.setText(\"Temps : \" + meilleur9 + \" \" + valeur9);\n }\n if (meilleur8 != 0 && i>=8) {\n resultat8.setText(\"Temps : \" + meilleur8 + \" \" + valeur8);\n }\n if (meilleur7 != 0 && i>=7) {\n resultat7.setText(\"Temps : \" + meilleur7 + \" \" + valeur7);\n }\n if (meilleur6 != 0 && i>=6) {\n resultat6.setText(\"Temps : \" + meilleur6 + \" \" + valeur6);\n }\n if (meilleur5 != 0&& i>=5) {\n resultat5.setText(\"Temps : \" + meilleur5 + \" \" + valeur5);\n }\n if (meilleur4 != 0 && i>=4) {\n resultat4.setText(\"Temps : \" + meilleur4 + \" \" + valeur4);\n }\n if (meilleur3 != 0 && i>=3) {\n resultat3.setText(\"Temps : \" + meilleur3 + \" \" + valeur3);\n }\n if (meilleur2 != 0 && i>=2) {\n resultat2.setText(\"Temps : \" + meilleur2 + \" \" + valeur2);\n }\n if (meilleur1 != 0) {\n resultat1.setText(\"Temps : \" + meilleur1 + \" \" + valeur1);\n }\n }\n\n @FXML\n void returnToMenu(MouseEvent event) throws Exception{\n AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource(\"/fxml/MainPage.fxml\")));\n levelRoot.getChildren().setAll(pane);\n }\n\n}\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/controller/TopPlayerController.java b/src/controller/TopPlayerController.java +--- a/src/controller/TopPlayerController.java (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) ++++ b/src/controller/TopPlayerController.java (date 1642711999936) +@@ -37,11 +37,20 @@ + private Text resultat9; + private Text resultat10; + ++ /** ++ * Initializes the controller class. ++ * @param url ++ * @param resourceBundle ++ */ + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + initialisationTexte(); + afficherRésultat(); + } ++ ++ /** ++ * Method to initialize the text ++ */ + public void initialisationTexte(){ + resultat1 = new Text(); + resultat1.setText(""); +@@ -108,6 +117,9 @@ + levelRoot.getChildren().addAll(resultat1,resultat2,resultat3,resultat4,resultat5,resultat6,resultat7,resultat8,resultat9,resultat10); + } + ++ /** ++ * Method to display the result ++ */ + public void afficherRésultat(){ + ResultatTxt resultatTxt = new ResultatTxt(); + ListeScore listeScore = new ListeScore(); +@@ -376,6 +388,11 @@ + } + } + ++ /** ++ * Méthod to return to the menu ++ * @param event ++ * @throws Exception ++ */ + @FXML + void returnToMenu(MouseEvent event) throws Exception{ + AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/MainPage.fxml"))); +Index: src/controller/PersoController.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package controller;\n\nimport javafx.fxml.FXML;\nimport javafx.scene.image.Image;\nimport javafx.scene.image.ImageView;\nimport javafx.scene.layout.AnchorPane;\nimport model.Avatar;\nimport model.Case;\nimport model.Map;\n\npublic class PersoController {\n\n @FXML\n public ImageView persoImageView;\n\n private Avatar avatar;\n private Case actualCase;\n private Case oldCase;\n\n public void createAvatar(int difficulty, int perso, Map map) {\n switch (perso) {\n case 1:\n this.avatar = new Avatar(1, \"image/personnage/Perso1.\",map.getCoordStartX(), map.getCoordStartY());\n break;\n case 2:\n this.avatar = new Avatar(2, \"image/personnage/Perso2.\", map.getCoordStartX(), map.getCoordStartY());\n break;\n case 3:\n this.avatar = new Avatar(3, \"image/personnage/Perso3.\", map.getCoordStartX(), map.getCoordStartY());\n break;\n default:\n System.out.println(\"Erreur de choix du personnage [createPerso] unknown number\");\n }\n }\n\n public AnchorPane playerInitialisation(int difficulty, int perso, Map map) {\n\n createAvatar(difficulty, perso, map);\n\n String imagePath = getPath() + \"2.png\";\n AnchorPane test = new AnchorPane();\n persoImageView = new ImageView(new Image(imagePath));\n persoImageView.setId(\"persoImageView\");\n persoImageView.setFitWidth(35);\n persoImageView.setFitHeight(35);\n System.out.println(\"X :\" + getX());\n persoImageView.setLayoutX(getX()*map.getSizeTile()-5);\n persoImageView.setLayoutY(getY()*map.getSizeTile()-5);\n test.getChildren().add(persoImageView);\n return test;\n }\n\n public String getPath(){\n return avatar.getImage();\n }\n\n public int getX(){\n return avatar.getCoordX();\n\n }\n\n public int getY(){\n return avatar.getCoordY();\n }\n\n public void setActualCase(Case actual){\n this.actualCase = actual;\n }\n\n public Case getActualCase() {\n return this.actualCase;\n }\n\n public void setOldCase(Case old){\n this.oldCase = old;\n }\n}\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/controller/PersoController.java b/src/controller/PersoController.java +--- a/src/controller/PersoController.java (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) ++++ b/src/controller/PersoController.java (date 1642711938926) +@@ -17,6 +17,12 @@ + private Case actualCase; + private Case oldCase; + ++ /** ++ * Method to create the avatar ++ * @param difficulty ++ * @param perso ++ * @param map ++ */ + public void createAvatar(int difficulty, int perso, Map map) { + switch (perso) { + case 1: +@@ -33,6 +39,13 @@ + } + } + ++ /** ++ * Method to initialize the avatar ++ * @param difficulty ++ * @param perso ++ * @param map ++ * @return the image of the avatar ++ */ + public AnchorPane playerInitialisation(int difficulty, int perso, Map map) { + + createAvatar(difficulty, perso, map); +@@ -50,27 +63,51 @@ + return test; + } + ++ /** ++ * Method to get the path of the image ++ * @return the path of the image ++ */ + public String getPath(){ + return avatar.getImage(); + } + ++ /** ++ * Method to get the X coordinate of the avatar ++ * @return the X coordinate of the avatar ++ */ + public int getX(){ + return avatar.getCoordX(); + + } + ++ /** ++ * Method to get the Y coordinate of the avatar ++ * @return the Y coordinate of the avatar ++ */ + public int getY(){ + return avatar.getCoordY(); + } + ++ /** ++ * Method to set the actual case of the avatar ++ * @param actual ++ */ + public void setActualCase(Case actual){ + this.actualCase = actual; + } + ++ /** ++ * Method to get the actual case of the avatar ++ * @return ++ */ + public Case getActualCase() { + return this.actualCase; + } + ++ /** ++ * Method to set the old case of the avatar ++ * @param old ++ */ + public void setOldCase(Case old){ + this.oldCase = old; + } +Index: src/controller/MainPageController.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>package controller;\n\nimport javafx.fxml.FXML;\nimport javafx.fxml.FXMLLoader;\nimport javafx.fxml.Initializable;\nimport javafx.scene.control.Button;\nimport javafx.scene.image.ImageView;\nimport javafx.scene.input.MouseEvent;\nimport javafx.scene.layout.AnchorPane;\nimport launcher.Main;\n\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Objects;\nimport java.util.ResourceBundle;\n\npublic class MainPageController implements Initializable {\n\n @FXML\n private AnchorPane mainRoot;\n\n @FXML\n private Button startGame;\n\n @FXML\n private Button viewScore;\n\n @FXML\n private ImageView exitGame;\n\n @FXML\n private ImageView loadGame;\n\n @Override\n public void initialize(URL url, ResourceBundle resourceBundle) {\n\n }\n\n @FXML\n void viewScore(MouseEvent event) throws Exception{\n AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource(\"/fxml/TopPlayers.fxml\")));\n mainRoot.getChildren().setAll(pane);\n }\n\n @FXML\n void startGame(MouseEvent event) throws Exception{\n AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource(\"/fxml/GameConfigurationMenu.fxml\")));\n mainRoot.getChildren().setAll(pane);\n }\n\n @FXML\n void exitGame(MouseEvent event) {\n try{\n Main.serialize();\n }\n catch(IOException e){\n //System.out.println(\"Could not save the progress :(\");\n }\n System.exit(0);\n }\n}\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/controller/MainPageController.java b/src/controller/MainPageController.java +--- a/src/controller/MainPageController.java (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) ++++ b/src/controller/MainPageController.java (date 1642711303342) +@@ -31,31 +31,44 @@ + @FXML + private ImageView loadGame; + ++ /** ++ * Initializes the controller class. ++ * @param url ++ * @param resourceBundle ++ */ + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + + } + ++ /** ++ * Go to the score page ++ * @param event ++ * @throws Exception ++ */ + @FXML + void viewScore(MouseEvent event) throws Exception{ + AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/TopPlayers.fxml"))); + mainRoot.getChildren().setAll(pane); + } + ++ /** ++ * Go to the game configuration page ++ * @param event ++ * @throws Exception ++ */ + @FXML + void startGame(MouseEvent event) throws Exception{ + AnchorPane pane = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/GameConfigurationMenu.fxml"))); + mainRoot.getChildren().setAll(pane); + } + ++ /** ++ * Exit the game ++ * @param event ++ */ + @FXML + void exitGame(MouseEvent event) { +- try{ +- Main.serialize(); +- } +- catch(IOException e){ +- //System.out.println("Could not save the progress :("); +- } + System.exit(0); + } + } +Index: src/controller/PageGameController.java +=================================================================== +diff --git a/src/controller/PageGameController.java b/src/controller/PageGameController.java +deleted file mode 100644 +--- a/src/controller/PageGameController.java (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) ++++ /dev/null (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) +@@ -1,47 +0,0 @@ +-package controller; +- +-import javafx.animation.Animation; +-import javafx.animation.KeyFrame; +-import javafx.animation.Timeline; +-import javafx.animation.Transition; +-import javafx.event.ActionEvent; +-import javafx.fxml.FXML; +-import javafx.fxml.Initializable; +-import javafx.scene.control.Button; +-import javafx.scene.image.Image; +-import javafx.scene.image.ImageView; +-import javafx.util.Duration; +-import model.Avatar; +-import model.Case; +-import model.Map; +- +-import java.net.URL; +-import java.util.ResourceBundle; +- +-public class PageGameController implements Initializable { +- +- @FXML +- private ImageView map; +- +- @FXML +- private Button boutonDe; +- +- @FXML +- private ImageView persoImageView; +- +- PersoController persoController; +- Case caseActuelle; +- MapController mapController; +- Case caseAncienne; +- String pathPerso; +- Image imagePerso; +- +- +- @Override +- public void initialize(URL url, ResourceBundle resourceBundle) { +- } +- +- public void lancerDe(ActionEvent actionEvent) throws InterruptedException { +- System.out.println("lancer de"); +- } +-} +Index: src/model/Database.java +=================================================================== +diff --git a/src/model/Database.java b/src/model/Database.java +deleted file mode 100644 +--- a/src/model/Database.java (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) ++++ /dev/null (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) +@@ -1,41 +0,0 @@ +-package model; +- +-import java.io.*; +-import java.util.ArrayList; +- +-public class Database implements Serializable { +- +- private int maxScore; +- private static Database db; +- +- private final ArrayList databaseFiles; +- +- public Database() { +- this.maxScore = 0; +- databaseFiles = new ArrayList(); +- } +- +- public int getMaxScore() { +- return maxScore; +- } +- +- public void setMaxScore(int maxScore) { +- if (this.maxScore < maxScore) this.maxScore = maxScore; +- } +- +- public void addData(DataTable d) { +- databaseFiles.add(d); +- } +- +- public void removeData(DataTable d) { +- databaseFiles.remove(d); +- } +- +- public static void resetScore() { +- db = new Database(); +- } +- +- public ArrayList getDatabaseFiles() { +- return databaseFiles; +- } +-} +\ No newline at end of file +Index: out/production/code/fxml/viewGame.fxml +=================================================================== +diff --git a/out/production/code/fxml/viewGame.fxml b/out/production/code/fxml/viewGame.fxml +deleted file mode 100644 +--- a/out/production/code/fxml/viewGame.fxml (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) ++++ /dev/null (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) +@@ -1,53 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +Index: out/production/code/fxml/viewJeu1.fxml +=================================================================== +diff --git a/out/production/code/fxml/viewJeu1.fxml b/out/production/code/fxml/viewJeu1.fxml +deleted file mode 100644 +--- a/out/production/code/fxml/viewJeu1.fxml (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) ++++ /dev/null (revision e06e64c60ceb30fbfa8ca79c93aa11058fd9d610) +@@ -1,39 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-