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 a6df2a7..7d6eace 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 @@ -6,6 +6,7 @@ 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 javafx.scene.image.Image; +import javafx.scene.image.ImageView; import javafx.scene.layout.StackPane; import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; @@ -30,33 +31,32 @@ public class Cell extends Rectangle { //NON-TEST public static StackPane setImageObject(Object object){ - //voir pour rajouter un répertoire ou stocker les images; - Image image; + Image image = null; StackPane sp = new StackPane(); //remplacer après par le switch dès que on aura implémenter les interfaces if(object instanceof Player){ - //image = new Image(); + image = new Image("file:resources/images/player.png"); } if(object instanceof EnergyBall){ - //image = new Image(); + image = new Image("file:resources/images/energyBall.png"); } if(object instanceof Bomb){ - //image = new Image(); + image = new Image("file:resources/images/bomb.jpg"); } if(object instanceof Mine){ - //image = new Image(); + image = new Image("file:resources/images/mine.webp"); } if(object instanceof Wall){ - //image = new Image(); + image = new Image("file:resources/images/wall.jpg"); } - /* + ImageView iv = new ImageView(image); iv.setFitHeight(40); iv.setFitWidth(40); - sp.getChilldren().add(iv); - */ + sp.getChildren().add(iv); + return sp; } diff --git a/client/src/main/java/fr/lnl/game/client/view/Main.java b/client/src/main/java/fr/lnl/game/client/view/Main.java new file mode 100644 index 0000000..daa8ef5 --- /dev/null +++ b/client/src/main/java/fr/lnl/game/client/view/Main.java @@ -0,0 +1,16 @@ +package fr.lnl.game.client.view; + +import javafx.application.Application; +import javafx.stage.Stage; + +public class Main extends Application{ + + public static void main(String[] args) { + launch(args); + } + + @Override + public void start(Stage primaryStage) throws Exception { + new GUI(); + } +} diff --git a/client/src/main/resources/images/bomb.jpg b/client/src/main/resources/images/bomb.jpg new file mode 100644 index 0000000..b354c21 Binary files /dev/null and b/client/src/main/resources/images/bomb.jpg differ diff --git a/client/src/main/resources/images/energyBall.png b/client/src/main/resources/images/energyBall.png new file mode 100644 index 0000000..5ff8898 Binary files /dev/null and b/client/src/main/resources/images/energyBall.png differ diff --git a/client/src/main/resources/images/mine.webp b/client/src/main/resources/images/mine.webp new file mode 100644 index 0000000..665e077 Binary files /dev/null and b/client/src/main/resources/images/mine.webp differ diff --git a/client/src/main/resources/images/player.png b/client/src/main/resources/images/player.png new file mode 100644 index 0000000..c2a71c7 Binary files /dev/null and b/client/src/main/resources/images/player.png differ diff --git a/client/src/main/resources/images/wall.jpg b/client/src/main/resources/images/wall.jpg new file mode 100644 index 0000000..8801b4f Binary files /dev/null and b/client/src/main/resources/images/wall.jpg differ