diff --git a/client/src/main/java/fr/lnl/game/client/view/Cell.java b/client/src/main/java/fr/lnl/game/client/view/Cell.java index 7028f9d..fa51585 100644 --- a/client/src/main/java/fr/lnl/game/client/view/Cell.java +++ b/client/src/main/java/fr/lnl/game/client/view/Cell.java @@ -5,6 +5,7 @@ import fr.lnl.game.server.games.grid.EnergyBall; import fr.lnl.game.server.games.grid.Mine; import fr.lnl.game.server.games.grid.Wall; import fr.lnl.game.server.games.player.Player; +import fr.lnl.game.server.utils.Cardinal; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.StackPane; @@ -37,17 +38,34 @@ public class Cell extends Rectangle { if(object instanceof Player){ image = new Image("file:resources/images/player.png"); } - if(object instanceof EnergyBall){ + else if(object instanceof EnergyBall){ image = new Image("file:resources/images/energyBall.png"); } - if(object instanceof Bomb){ + else if(object instanceof Bomb){ image = new Image("file:resources/images/bomb.jpg"); } - if(object instanceof Mine){ + else if(object instanceof Mine){ image = new Image("file:resources/images/mine.webp"); } else{ - image = new Image("file:resources/images/wall.jpg"); + //test + if(((Wall)object).getCardinal()== Cardinal.NORTH){ + image = new Image("file:resources/topWall.png"); + }else if(((Wall)object).getCardinal()== Cardinal.SOUTH) { + image = new Image("file:resources/bottomWall.png"); + }else if(((Wall)object).getCardinal()== Cardinal.EAST) { + image = new Image("file:resources/rightWall.png"); + }else if(((Wall)object).getCardinal()== Cardinal.WEST) { + image = new Image("file:resources/leftWall.png"); + }else if(((Wall)object).getCardinal()== Cardinal.NORTH_EAST) { + image = new Image("file:resources/topRightWall.png"); + }else if(((Wall)object).getCardinal()== Cardinal.NORTH_WEST) { + image = new Image("file:resources/topLeftWall.png"); + }else if(((Wall)object).getCardinal()== Cardinal.SOUTH_EAST) { + image = new Image("file:resources/bottomRightWall.png"); + }else{ + image = new Image("file:resources/bottomLeftWall.png"); + } } ImageView iv = new ImageView(image); diff --git a/client/src/main/java/fr/lnl/game/client/view/GUI.java b/client/src/main/java/fr/lnl/game/client/view/GUI.java index 175918f..95ec317 100644 --- a/client/src/main/java/fr/lnl/game/client/view/GUI.java +++ b/client/src/main/java/fr/lnl/game/client/view/GUI.java @@ -52,9 +52,8 @@ public class GUI { private Parent createContent() { Pane principalPane = new Pane(); principalPane.setPrefSize(width * cellSize, height * cellSize); - //PARTIE1 - //à définir avec n pour moduler la taille du plateau + //à définir avec n pour moduler la taille du plateau for (int i = 0; i < 16; i++) { for (int j = 0; j < 16; j++) { Cell cell = new Cell(i, j); @@ -62,7 +61,6 @@ public class GUI { } } - //PARTIE2 board = grid.getBoard(); for (int i = 0; i < 16; i++) { for (int j = 0; j < 16; j++) { @@ -71,11 +69,20 @@ public class GUI { addToPrincipalPanel(value.getA(), principalPane, i, j); } if (value.getB() instanceof Wall || value.getB() instanceof EnergyBall || value.getB() instanceof Mine || value.getB() instanceof Bomb) { + System.out.println(value.getB()); addToPrincipalPanel(value.getB(), principalPane, i, j); } } } - //PARTIE3 + + Rectangle shape = new Rectangle(); + shape.setX(700); + shape.setY(20); + shape.setWidth(200); + shape.setHeight(600); + shape.setFill(javafx.scene.paint.Color.WHITE); + + Button followingButton = new Button("SUIVANT"); followingButton.setLayoutX(775); followingButton.setLayoutY(600); @@ -84,6 +91,7 @@ public class GUI { //add un eventListener au button principalPane.getChildren().add(followingButton); + //pas compris le principe return principalPane; } diff --git a/client/src/main/resources/images/bottomLeftWall.PNG b/client/src/main/resources/images/bottomLeftWall.PNG new file mode 100644 index 0000000..af2c630 Binary files /dev/null and b/client/src/main/resources/images/bottomLeftWall.PNG differ diff --git a/client/src/main/resources/images/bottomRightWall.PNG b/client/src/main/resources/images/bottomRightWall.PNG new file mode 100644 index 0000000..3e87801 Binary files /dev/null and b/client/src/main/resources/images/bottomRightWall.PNG differ diff --git a/client/src/main/resources/images/bottomWall.PNG b/client/src/main/resources/images/bottomWall.PNG new file mode 100644 index 0000000..3287196 Binary files /dev/null and b/client/src/main/resources/images/bottomWall.PNG differ diff --git a/client/src/main/resources/images/rightWall.PNG b/client/src/main/resources/images/rightWall.PNG new file mode 100644 index 0000000..f2f5278 Binary files /dev/null and b/client/src/main/resources/images/rightWall.PNG differ diff --git a/client/src/main/resources/images/topLeftWall.PNG b/client/src/main/resources/images/topLeftWall.PNG new file mode 100644 index 0000000..73a2dd5 Binary files /dev/null and b/client/src/main/resources/images/topLeftWall.PNG differ diff --git a/client/src/main/resources/images/topRightWall.PNG b/client/src/main/resources/images/topRightWall.PNG new file mode 100644 index 0000000..74ff2dc Binary files /dev/null and b/client/src/main/resources/images/topRightWall.PNG differ diff --git a/client/src/main/resources/images/topWall.PNG b/client/src/main/resources/images/topWall.PNG new file mode 100644 index 0000000..c769e82 Binary files /dev/null and b/client/src/main/resources/images/topWall.PNG differ