diff --git a/code/ressources/image/terrain/bonus.png b/code/ressources/image/terrain/bonus.png new file mode 100644 index 0000000..0f3a67c Binary files /dev/null and b/code/ressources/image/terrain/bonus.png differ diff --git a/code/ressources/image/terrain/malus.png b/code/ressources/image/terrain/malus.png new file mode 100644 index 0000000..8f7cea5 Binary files /dev/null and b/code/ressources/image/terrain/malus.png differ diff --git a/code/src/controller/MapController.java b/code/src/controller/MapController.java index 2f0a606..454b1fa 100644 --- a/code/src/controller/MapController.java +++ b/code/src/controller/MapController.java @@ -38,7 +38,8 @@ public class MapController implements Initializable { private final Image w = new Image("/image/terrain/chemin.png"); private final Image x = new Image("/image/terrain/multiarbre1.png"); private final Image y = new Image("/image/terrain/multiarbre2.png"); - private final Image z = new Image("/image/terrain/pierre.png"); + private final Image z1 = new Image("/image/terrain/bonus.png"); + private final Image z2 = new Image("/image/terrain/malus" + ".png"); private final Image aa = new Image("/image/terrain/pierre2.png"); private final Image ab = new Image("/image/terrain/pierre1.png"); private final Image ac = new Image("/image/terrain/tombe1.png"); @@ -201,8 +202,14 @@ public class MapController implements Initializable { for (int x = 0 ; x < grid[y].length ; x++) { if(grid[y][x] != b) continue; for(Case c : array) { - if (c.getCoordY() == y && c.getCoordX() == x && (c.isBonus() || c.isMalus())) { - ImageView imageView = new ImageView(z); + if (c.getCoordY() == y && c.getCoordX() == x && c.isBonus()) { + ImageView imageView = new ImageView(z1); + imageView.setFitWidth(tileSize); + imageView.setFitHeight(tileSize); + gridPane.add(imageView, x, y); + } + else if(c.getCoordY() == y && c.getCoordX() == x && c.isMalus()){ + ImageView imageView = new ImageView(z2); imageView.setFitWidth(tileSize); imageView.setFitHeight(tileSize); gridPane.add(imageView, x, y); @@ -317,8 +324,14 @@ public class MapController implements Initializable { for (int x = 0 ; x < grid[y].length ; x++) { if(grid[y][x] != b) continue; for(Case c : array) { - if (c.getCoordY() == y && c.getCoordX() == x && (c.isBonus() || c.isMalus())) { - ImageView imageView = new ImageView(z); + if (c.getCoordY() == y && c.getCoordX() == x && c.isBonus()) { + ImageView imageView = new ImageView(z1); + imageView.setFitWidth(tileSize); + imageView.setFitHeight(tileSize); + gridPane.add(imageView, x, y); + } + else if(c.getCoordY() == y && c.getCoordX() == x && c.isMalus()){ + ImageView imageView = new ImageView(z2); imageView.setFitWidth(tileSize); imageView.setFitHeight(tileSize); gridPane.add(imageView, x, y); @@ -433,8 +446,14 @@ public class MapController implements Initializable { for (int x = 0 ; x < grid[y].length ; x++) { if(grid[y][x] != b) continue; for(Case c : array) { - if (c.getCoordY() == y && c.getCoordX() == x && (c.isBonus() || c.isMalus())) { - ImageView imageView = new ImageView(z); + if (c.getCoordY() == y && c.getCoordX() == x && c.isBonus()) { + ImageView imageView = new ImageView(z1); + imageView.setFitWidth(tileSize); + imageView.setFitHeight(tileSize); + gridPane.add(imageView, x, y); + } + else if(c.getCoordY() == y && c.getCoordX() == x && c.isMalus()){ + ImageView imageView = new ImageView(z2); imageView.setFitWidth(tileSize); imageView.setFitHeight(tileSize); gridPane.add(imageView, x, y); diff --git a/code/src/model/BonusCase.java b/code/src/model/BonusCase.java deleted file mode 100644 index 434c5cd..0000000 --- a/code/src/model/BonusCase.java +++ /dev/null @@ -1,9 +0,0 @@ -package model; - -public class BonusCase extends Case { - - public BonusCase(int idCase, int coordX, int coordY, boolean isStart, boolean isBonus, boolean isMalus, boolean isEnd, Map map, Bonus bonus) { - super(idCase, coordX, coordY, isStart, isBonus, isMalus, isEnd, map); - Bonus bonus1 = bonus.randomGet(); - } -} diff --git a/code/src/model/DataTable.java b/code/src/model/DataTable.java index d608263..9369832 100644 --- a/code/src/model/DataTable.java +++ b/code/src/model/DataTable.java @@ -10,10 +10,9 @@ public class DataTable implements Serializable { private static int id = 0; private int gameId; - private String playerName; private int Maxscore; private int rounds; - private double timeElapsed; + private double timer; public DataTable(int levelNumber) { id++; @@ -24,8 +23,7 @@ public class DataTable implements Serializable { id++; this.gameId = id; this.Maxscore = 0; - this.timeElapsed = 0; - this.playerName = ""; + this.timer = 0; this.rounds = 0; //this.score=score; Calcul du score avec la difficulté ! @@ -34,8 +32,7 @@ public class DataTable implements Serializable { //Function update public void update(int score, String name, double time, int rounds) { this.Maxscore = score; - this.playerName = name; - this.timeElapsed = time; + this.timer = time; this.rounds = rounds; } @@ -49,8 +46,8 @@ public class DataTable implements Serializable { } public double getTimeElapsed() { - System.out.println(this.timeElapsed); - return this.timeElapsed; + System.out.println(this.timer); + return this.timer; } public int maxScore() { @@ -58,11 +55,6 @@ public class DataTable implements Serializable { return this.Maxscore; } - public String playerName() { - System.out.println(this.playerName); - return this.playerName; - } - public int getRounds(){ System.out.println(this.rounds); return this.rounds; @@ -72,8 +64,4 @@ public class DataTable implements Serializable { System.out.println(this.gameId); return this.gameId; } - - public String toString() { - return this.playerName + " : " + this.Maxscore; - } } \ No newline at end of file diff --git a/code/src/model/MalusCase.java b/code/src/model/MalusCase.java deleted file mode 100644 index 43208c5..0000000 --- a/code/src/model/MalusCase.java +++ /dev/null @@ -1,10 +0,0 @@ -package model; - -public class MalusCase extends Case{ - - public MalusCase(int idCase, int coordX, int coordY, boolean isStart, boolean isBonus, boolean isMalus, boolean isEnd, Map map, Malus malus) { - super(idCase, coordX, coordY, isStart, isBonus, isMalus, isEnd, map); - Malus malus1 = malus.randomGet(); - } - -}