From 0876b4c7732d1f5651eb51fc87b51b6cb7db0dbe Mon Sep 17 00:00:00 2001 From: Valentin Lucas <21901740@etu.unicaen.fr> Date: Thu, 2 Dec 2021 19:56:37 +0100 Subject: [PATCH] Ajouts d'images et quelques modification de cell et Gui --- .../java/fr/lnl/game/client/view/Cell.java | 26 +++++++++++++++--- .../java/fr/lnl/game/client/view/GUI.java | 16 ++++++++--- .../main/resources/images/bottomLeftWall.PNG | Bin 0 -> 6059 bytes .../main/resources/images/bottomRightWall.PNG | Bin 0 -> 6136 bytes .../src/main/resources/images/bottomWall.PNG | Bin 0 -> 4777 bytes .../src/main/resources/images/rightWall.PNG | Bin 0 -> 6101 bytes .../src/main/resources/images/topLeftWall.PNG | Bin 0 -> 5623 bytes .../main/resources/images/topRightWall.PNG | Bin 0 -> 6346 bytes client/src/main/resources/images/topWall.PNG | Bin 0 -> 4741 bytes 9 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 client/src/main/resources/images/bottomLeftWall.PNG create mode 100644 client/src/main/resources/images/bottomRightWall.PNG create mode 100644 client/src/main/resources/images/bottomWall.PNG create mode 100644 client/src/main/resources/images/rightWall.PNG create mode 100644 client/src/main/resources/images/topLeftWall.PNG create mode 100644 client/src/main/resources/images/topRightWall.PNG create mode 100644 client/src/main/resources/images/topWall.PNG 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 0000000000000000000000000000000000000000..af2c6309af8867c5dff1b5e07154af0efbf33b7c GIT binary patch literal 6059 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8Y9Be?5)7S2I0V&4fAa^H*b?0PW0y!?J5uRzj zz6@GGHU|S^dnN-5NC^;20Wkvu^8!W&W+2T75?jColV$v}fEmFCDJ;)B*TBFaF6!yx z7*fIb_U^%~SW5<%gB2(K|Nk`mq~7$Kku5Lg={X;W(g+LJpXJW<@7Kr2$Di-Fzq)>X zmcdRA0R@MK1Mivs|Ec?6%gDq6}pQ1an1)8*jvazjJ9Uw`DI=GISXR6fWZrXK6YwZ z^Wgd8FYSEu&;PG?etmuV{hVLzJN|A3dBH&Af$*<{mrBAw*E#qfSn%CyY6r*%Y(U41 z3Xg`#Xo48c4WmWDXz@5&H;h({qpgC`Cedg!akPy*+CdoY9gX%FN4v|TV+ErFC8MK6 zkddH3$HFFr3Uf{gM7GS0uS_-L0aXv8m?iLG{ZekN$ZPeChTBnyA|od5J!ja~g~ z_uo4~gO3gmyc*Z9U!TAKwECC)%R4NJu z)i$<*6ExZ?@MGJ7_4T#i_g~(3_PG*RWQX$s^)J>{AGpAyrUfbq7y5t1Kt^E8IV479 d@Pxr1?nf;=uNPc;n++N$_jL7hS?83{1ONxq>ZJex literal 0 HcmV?d00001 diff --git a/client/src/main/resources/images/bottomRightWall.PNG b/client/src/main/resources/images/bottomRightWall.PNG new file mode 100644 index 0000000000000000000000000000000000000000..3e87801394b12e783ff2b3e76a37259cd524c7ba GIT binary patch literal 6136 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8Y9Be?5)7S2I0V&4fAa^H*b?0PW0y!?J5uRzj zz6@GGHU|S^dnN-5NC^;20Wkvu^8!W&W+2T75?jColV$v}fEmFCDJ;)B*TBFap5*D` z7*fIb_O4@Jh@k+hqtw~I>+ftx_gw0|srm1f!ym<0PMq-L&!=_UeqFgg zzjj8spn^jKL*sN7mcL8azg^41A)rvOwqZg1?@ZeskkU9IfiKhdZQCvcRCZu1Q&ZjB z>OWp=eT$f6i+g%{WBqWG1m zV#%MF-$r1g7@4@4?!Vvv-}&|P&nN$@)j6N< z7f02~*JhxBL;(vGg%|A$&O%1{f*dY*$8P5YaSkXlI@+`3wt>g_rZ6?dz1rmq&c1w{ z9KRGZjKK+cfr!ADpzFC{Lkm0{F7P|fRs`F&v|+*YU3tRbp+jfj=qAT49 zrL)0?$^eHzoiC(;O2q~TO@$Xr*WCsi`d~uC0{JF0XRvKvjE=PS!jGTxAK!ofy}s_w zdC+Jq&~47ZfRk@3f%rWKI0n0HAHA&R^mE^L4D7VNY}M@C2aBPCs6MLEETn6@Vt9QXzr3NM;x_(2Apb%73>wA~vV zer&8PwE~wl!HPDhD!hpPR0fIO1q}=MldN39ing(^)Oz331G`TG7^RLr%fYd7U|Pch dntS38<4zBr=YDsqHiJgpJzf1=);T3K0RZE?nf(9& literal 0 HcmV?d00001 diff --git a/client/src/main/resources/images/bottomWall.PNG b/client/src/main/resources/images/bottomWall.PNG new file mode 100644 index 0000000000000000000000000000000000000000..328719693a63ee845a398f2e03904d287c2d0823 GIT binary patch literal 4777 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8Y9Be?5)7S2I0V&4fAa^H*b?0PW0y!?J5uRzj zz6@GGHU|S^dnN-5NC^;20Wkvu^8!W&W+2T75?jColV$v}fEmFCDJ;)B*TBFaB<$(p z7*fIb_LgIo6C)2xfbQP^Q**ufA2j&PI9i-tCln`k*j=7qo{5D+K*6DbfpL^E8VI8) zVKf(v=7P~&Fq#WSbHQjX7|jKvxnMLGjOK#TTripom{_!!&fj0R-Yeag6C4_i#*OPY zd$I{a`p%||jd6>w&H(qK?{IQ_vCf_h?p8baIxM)JVX6l1V3#v7{XKU}1)QM*gauxh zM)iWtIxx4vVgF{cPO$DPEG$*MVaZ@c1?mbH-mmdh0_z^aR($w-a>e!6Ur#=srwSQq zxW{2L|Gc^A|M+U>{uv_RFl@|aY}{8Xe;dN_a9H5((*+K~1KS!L?(ge=3kgq^58u6a z*KczTfl97xF#mG*_KhBJ*d1YFvRxMB0nV>wtSrCY<>t77IZ2F-a>1G^V9R$iG1Y!I zGgAh0Ha0l)uM`miMPg$t&;ixbvmp+Ma9D6WgbNZq>wpf}+j|z`03C%3$y%-8L6d}V zhXwEN9ZLgq6vPBx7*2Hp$J+*Ng$w2R$;M!g05`{%8D5Iu@s%5*0xx!N-zW*@bg;5i m`7E6PcKI7F4%&O;0Ds#f*4*8@kK2NVi9B8XT-G@yGywo58Mo8` literal 0 HcmV?d00001 diff --git a/client/src/main/resources/images/rightWall.PNG b/client/src/main/resources/images/rightWall.PNG new file mode 100644 index 0000000000000000000000000000000000000000..f2f5278ddc04ddbe187b500e3dbe0641478dc5ff GIT binary patch literal 6101 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8Y9Be?5)7S2I0V&4fAa^H*b?0PW0y!?J5uRzj zz6@GGHU|S^dnN-5NC^;20Wkvu^8!W&W+2T75?jColV$v}fEmFCDJ;)B*TBFaZtv;h z7*fIb_U^%4Wk&%P$F&asW8)+j>^`>#e`m!T{c--&YRB`c7&6%0 z(y(BDz;;jYFl`$vORdC}=b%C8h69|8j`j=lCWD4=Ie54^ei^JdF9;sM6=rIxbGoYr z9<`Ma6Zn!CFdsA=&B&w<9FK0<}cyV}vojcfEKMsyxoTanD7A8bETxfT! z?E{-TM?m0<@GCP;u!S2M7VtO!k^!4*p{Vde{Yoxq$eW=tvC)14H^=jM`QF{2A$3nz KKbLh*2~7ZQfL}KN literal 0 HcmV?d00001 diff --git a/client/src/main/resources/images/topLeftWall.PNG b/client/src/main/resources/images/topLeftWall.PNG new file mode 100644 index 0000000000000000000000000000000000000000..73a2dd5178939c38af150674c9e257a20b1586c9 GIT binary patch literal 5623 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8Y9Be?5)7S2I0V&4fAa^H*b?0PW0y!?J5uRzj zz6@GGHU|S^dnN-5NC^;20Wkvu^8!W&W+2T75?jColV$v}fEmFCDJ;)B*TBFan&|1` z7*fIb_SQu&CPs;tK=Yda;rDcQeaT|JnD2MNH{so!pNSK!^0wdp`Qw{w0|O%y3rEd{ z1J~K@ce|@QfcgJecy5^3JDkPf>jG}a7cV{=u{E_D`|em29$GX zaBw)VfZa=^5v)X_#2jK26BC~mIF>Vm4N?F)g;})=Vgt`EX=*w3dw7b)`Ol*Hk8Q#B z9dPHCIbQhlXRXtIpXaS$n;+D&@cjB+^3W5aAeFJXZss{|PLKx<{04@~_m_tzLws|Z zN&n~a9qInx=iC3W|6N<>2KLW1)*7eyy!bLuFq{CY_nF!R*1M^}aRdt=u$BAQ@m#nc zoOJ$h{b+e701n?_kferC>K}C~Ey|S9P#q1`p;G^irq$83I+|9g-mDzWR-@T!G+T{k zD^QYP7H#Ev!f^tSsbM(q}wWpRW%d;F}=+fzvjAV*_Z+Yy)txPCRPb kM9|>QC*Ww{kQe^I`<<8L!;POoput-PPgg&ebxsLQ0HOZ;CIA2c literal 0 HcmV?d00001 diff --git a/client/src/main/resources/images/topRightWall.PNG b/client/src/main/resources/images/topRightWall.PNG new file mode 100644 index 0000000000000000000000000000000000000000..74ff2dcb07920c32bc3b560292d793bd97e9f489 GIT binary patch literal 6346 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8Y9Be?5)7S2I0V&4fAa^H*b?0PW0y!?J5uRzj zz6@GGHU|S^dnN-5NC^;20Wkvu^8!W&W+2T75?jColV$v}fEmFCDJ;)B*TBFaVdClH z7*fIb_LgIwjJtrVi)V&>hO6PaxUzFl7*zklEVKdGfH8d>v%?qL#8rfM`{x&NA zVgc({cu~g;F^7@SvHn4aT_Z>*2gk1aU|OKU!Qq0u#Ug)@PDY^7=0n8j2jxH8-oJlu zls66Rk3ae>`}Xa#`#1NW(|?PN;*fwi&&~1cdGB6`k85HaF4+6MVTA<7XQrlqmC5-K zU(1Vo{13k4|Hu7bKX(NqD0l=cGzwnVOMDmqbx^rV1T3;cRpG_ z&J`RDd7K=-bSvMhf+c@H4nbePp_4&nFkGo)W-KupPtJ5=cHei1__Cdh6VjHhorzEv4Df4 z>Y}kXI3V3vSZbdLT!Tc4tHXuvd6D1%GEh=@q1?WK4IB>|OigiL&Ip0SSCG+B-m=9M zocjwhopuc4vt?Z6xTR{P3>w}Aa1)EY*~Vf!v%M~L|(9|0W2(gU(AHWnle+9 zT@gn%B-sFMb3LyEwoC$O=tSp;W^km7FglKUVKf#%sckeNjpl{X5^1zh9jzAx6h>?3 z(FVq78)>wqI@;Lg5E$(*jP}|_JD#I`XYf$a=m^H>Ak64E(twQS#Vc1s2kri}9Qf|P z=gBeaKdp7ncda1doNuCd$bo^sNTF$5@HXlNR?0O1aPQ*;nEleRzQ*)*r$*< z0Eapx=|Ex}93qfZGpcwrphi=|Xf7Dd1*5rOG#8BKg3(+snhQpA!DucR%>|>mVA$t^ c2hUmF9h}da+Y