Modification de cell et ajout d'un main temporaire + ajout d'images
This commit is contained in:
parent
de8c258322
commit
1b8f9a2b30
@ -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.grid.Wall;
|
||||||
import fr.lnl.game.server.games.player.Player;
|
import fr.lnl.game.server.games.player.Player;
|
||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
|
import javafx.scene.image.ImageView;
|
||||||
import javafx.scene.layout.StackPane;
|
import javafx.scene.layout.StackPane;
|
||||||
import javafx.scene.paint.Color;
|
import javafx.scene.paint.Color;
|
||||||
import javafx.scene.shape.Rectangle;
|
import javafx.scene.shape.Rectangle;
|
||||||
@ -30,33 +31,32 @@ public class Cell extends Rectangle {
|
|||||||
|
|
||||||
//NON-TEST
|
//NON-TEST
|
||||||
public static StackPane setImageObject(Object object){
|
public static StackPane setImageObject(Object object){
|
||||||
//voir pour rajouter un répertoire ou stocker les images;
|
Image image = null;
|
||||||
Image image;
|
|
||||||
StackPane sp = new StackPane();
|
StackPane sp = new StackPane();
|
||||||
//remplacer après par le switch dès que on aura implémenter les interfaces
|
//remplacer après par le switch dès que on aura implémenter les interfaces
|
||||||
|
|
||||||
if(object instanceof Player){
|
if(object instanceof Player){
|
||||||
//image = new Image();
|
image = new Image("file:resources/images/player.png");
|
||||||
}
|
}
|
||||||
if(object instanceof EnergyBall){
|
if(object instanceof EnergyBall){
|
||||||
//image = new Image();
|
image = new Image("file:resources/images/energyBall.png");
|
||||||
}
|
}
|
||||||
if(object instanceof Bomb){
|
if(object instanceof Bomb){
|
||||||
//image = new Image();
|
image = new Image("file:resources/images/bomb.jpg");
|
||||||
}
|
}
|
||||||
if(object instanceof Mine){
|
if(object instanceof Mine){
|
||||||
//image = new Image();
|
image = new Image("file:resources/images/mine.webp");
|
||||||
}
|
}
|
||||||
if(object instanceof Wall){
|
if(object instanceof Wall){
|
||||||
//image = new Image();
|
image = new Image("file:resources/images/wall.jpg");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
ImageView iv = new ImageView(image);
|
ImageView iv = new ImageView(image);
|
||||||
iv.setFitHeight(40);
|
iv.setFitHeight(40);
|
||||||
iv.setFitWidth(40);
|
iv.setFitWidth(40);
|
||||||
sp.getChilldren().add(iv);
|
sp.getChildren().add(iv);
|
||||||
*/
|
|
||||||
return sp;
|
return sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
16
client/src/main/java/fr/lnl/game/client/view/Main.java
Normal file
16
client/src/main/java/fr/lnl/game/client/view/Main.java
Normal file
@ -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();
|
||||||
|
}
|
||||||
|
}
|
BIN
client/src/main/resources/images/bomb.jpg
Normal file
BIN
client/src/main/resources/images/bomb.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 69 KiB |
BIN
client/src/main/resources/images/energyBall.png
Normal file
BIN
client/src/main/resources/images/energyBall.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
BIN
client/src/main/resources/images/mine.webp
Normal file
BIN
client/src/main/resources/images/mine.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
BIN
client/src/main/resources/images/player.png
Normal file
BIN
client/src/main/resources/images/player.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.8 KiB |
BIN
client/src/main/resources/images/wall.jpg
Normal file
BIN
client/src/main/resources/images/wall.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 56 KiB |
Loading…
Reference in New Issue
Block a user