From 6e3323bc3749bc5108cce80e79cbc2bb8e1ec3e8 Mon Sep 17 00:00:00 2001 From: Maxim LALANE Date: Tue, 19 Dec 2023 14:18:40 +0100 Subject: [PATCH] encore correction --- Snake/Afficher.c | 8 +- Snake/Afficher.o | Bin 0 -> 4968 bytes Snake/Chemin.c | 13 +++ Snake/Chemin.h | 1 + Snake/Chemin.o | Bin 0 -> 2736 bytes Snake/Deplacement.c | 208 +++++++++++++++++++++++++++++++++++++++++++- Snake/Deplacement.h | 4 +- Snake/Deplacement.o | Bin 0 -> 10352 bytes Snake/Menu.c | 104 ++++++++++++++++++++++ Snake/Menu.h | 14 +++ Snake/Menu.o | Bin 0 -> 6944 bytes Snake/ModifTab.c | 29 +++--- Snake/ModifTab.h | 2 +- Snake/ModifTab.o | Bin 0 -> 3008 bytes Snake/exec | Bin 0 -> 29320 bytes Snake/main.c | 49 ++++++----- Snake/main.o | Bin 0 -> 3088 bytes Snake/makefile | 20 +++-- 18 files changed, 406 insertions(+), 46 deletions(-) create mode 100644 Snake/Afficher.o create mode 100644 Snake/Chemin.o create mode 100644 Snake/Deplacement.o create mode 100644 Snake/Menu.c create mode 100644 Snake/Menu.h create mode 100644 Snake/Menu.o create mode 100644 Snake/ModifTab.o create mode 100755 Snake/exec create mode 100644 Snake/main.o diff --git a/Snake/Afficher.c b/Snake/Afficher.c index a66ebf4..faa4708 100644 --- a/Snake/Afficher.c +++ b/Snake/Afficher.c @@ -29,11 +29,17 @@ void AfficheTab(int tab[H][L], int posx, int posy, int i, int j){ RemplirArc(posx+5,posy+5,10,10,360,360); } if(tab[i][j]==30){ + c=CouleurParNom("black"); + ChoisirCouleurDessin(c); + RemplirRectangle(posx,posy,20,20); c=CouleurParNom("red"); ChoisirCouleurDessin(c); RemplirArc(posx,posy,20,20,360,360); } - if(tab[i][j]==50){ + if(tab[i][j]==50){ + c=CouleurParNom("black"); + ChoisirCouleurDessin(c); + RemplirRectangle(posx,posy,20,20); c=CouleurParNom("purple"); ChoisirCouleurDessin(c); RemplirArc(posx,posy,20,20,360,360); diff --git a/Snake/Afficher.o b/Snake/Afficher.o new file mode 100644 index 0000000000000000000000000000000000000000..2ab848c7dbb01663d9190d56f9b45b1645eade7d GIT binary patch literal 4968 zcmc&&U1%It6u!IpYqe=&tSD540r0X(A}qWV1WTuGv5C&e)_j zvCT%!Fa$zHD1r}yAo`*RVz$^c#)sGkH6qwPRLnyQK?_ERut*@DGjs3uWU?_o7CbO} z@BPj>-#zEtzmPYSV{KlKhe`3UBkaydqKqw8-03&l-Db9zm9s9@yrpJt*Qw_4qG{YT zyB5sjH(E{Qx~1GuL-VRRuYSEyqSj(lq?)s;r7WtRSxdRDUbKow-<&ZHsS_ngsG4(& zPOId=DksO5v0y1Tv-?1I34esy*7!5I8iVg_g3Y{?g^83GBFoHpvy~Ve{%kWiPsP}0 z;I-9Uc2|s@--daa{=!z7cj*VWYFcWHY*w1WE4G;z7PQ1JXh|R&flU~g!r$yYSX}(s zW^oS~gPTpcvp{XHH6iYFb2j{cAx>WXMx0$Ap4~Ym2Nh;>%8Ju0Ve@-nPFc1)k6Oda z*6}5)YsE6~bS?(W`~l4Sxw3+&IiSF7JeF7%VS+3qR8XMT}j+o^yGuyGz#iS?}Up>Vz_B z{-{no0A6ewsepG12ZBSH%zABfc6toy|CXvryqLo3K_^tb#I_fOynES@NZdE$-N>e4 zlWclp!O#E;2l;@npKC)-FUf<6evS3=}X3%ldtAzdsnTmzR_RrulF_7H8j>8u74Vn1u2Hl2OlO3X3WbxGl)s? zh%sCUw&00F@to;kp214b{yk;8CPDcyVECbY1#8Cwdn@1awv?9^eOUx1w(eP5%h>DK zO1<|rRNMMfLjV05{nfnw?7!%RYF&eI7qdTC*C_xfD){0eZZH2Dmpw45BKCHUfISEw zK0t1%2A~k$v;qG72KdVx;1R$v9vO#SQ@~OJKP(o}t|ee2@D+;Z?G5mEHo!jw9Oo?& zC6fFs(AO6YMKtaY$!=$`m$f8~m}c-3LEfH>vzACQnvQY-wrc5gG{HKwcq$g<9a>0- ztqxn;!8L*ilK{_i=Z#L{wrA-?iboTAA5%g+%C$~yP}f*@cUp%N)g6iqboT|LvAj~z4;FP~g9B|ARj$=OGoWLbNo&#G%BJTQB5}fisPH-B(U*Ona z{U37J*&$+2<8LE4?yzf0D&#$MfvB6J&pgGi~j)lq5Mkh zDgPe?r~FkI90<-!<8Ku>y3zQL5qrviir|z#O>i3j8G%dwM=%JGQDRT|FA$vae?f2> z|0=;TH@Pk^;Q&O=Tk8y2ufVaP^KydIc`bs|ye^RamqT>2^`&MoXrHMalS}!T8AEiOMbaOBg7uNGX6n= zQ+~_EqhQb=?-P4khbe;7I($cPS_hxa=F|aWmC`Iah~X#SyB-%V-@9`zT)tDxpB{?q z@FMxsI(OQL>~Sp?^y~0uFn>6x2bsS&oo0TXbOxbhJgy}`mq_ZGAO1#q%6?YFxIba| zQ#_f{xIP3v$fQNO`*<*}iAeri;{$iRf^jXVG>gGcqMlMGu4_4D`=N(>s5y@~opC&* zAmhUSUg)DQ-u)=@9)1k^h>K&4DqHS%2PAO!{7(XooICZe2Vdl*djf_`&VLdIMBMW~ z13JX&hz)l8MEvq^R;iZ$vV9H|vM+709o=I79bk*+(H;M|@OQ^0>yLAwyb2%A@AjV( z{uj}Rh}$1`VWIV}6#rN15x%(oxFw{&T>nCIqss|Q3gnz94xW9S$L)`t?zIPq%?rcN XaX`df>-#`g$Ui0G*NHE7-TwaoNri#E literal 0 HcmV?d00001 diff --git a/Snake/Chemin.c b/Snake/Chemin.c index e97a6ff..1170877 100644 --- a/Snake/Chemin.c +++ b/Snake/Chemin.c @@ -49,6 +49,19 @@ int VerifChemin(int tab[H][L], int x, int y){ } } +/*Verification sir le joueuer a gagner ou perdu*/ +int Gagne(int tab[H][L]){ + int i,j; + for(i=0;i<=H;i++){ + for(j=0;j<=L;j++){ + if(tab[i][j]==0||tab[i][j]==30||tab[i][j]==30){ + return 1; + } + } + } + return 0; +} + /*regarde la case ou la queue est pour savoir ou elle va aller ensuite*/ int VoirCase(int tab[H][L],int x, int y,int defaut){ if(tab[x][y]==9){ diff --git a/Snake/Chemin.h b/Snake/Chemin.h index 3c95c71..66faedb 100644 --- a/Snake/Chemin.h +++ b/Snake/Chemin.h @@ -15,5 +15,6 @@ int Semage(int tab[H][L], int direction, int sxmax, int symax, int *pause, int * unsigned long TempsArret(int *temoin); int VerifChemin(int tab[H][L], int x, int y); int VoirCase(int tab[H][L], int x, int y, int defaut); +int Gagne(int tab[H][L]); #endif // CHEMIN_H diff --git a/Snake/Chemin.o b/Snake/Chemin.o new file mode 100644 index 0000000000000000000000000000000000000000..0482372362b597d1e3311ba638aecd31c275745e GIT binary patch literal 2736 zcmbVOO=ufO6n-oDH;H34^iYTi$|clJx>!zwAuT~cY`h6p!EWSJO}bXbwy-6+t6gwH zLQB+!EDNE>6mrNVm!5kFCB@F~au0FWnfP#E*z=u5uocCsDyHr4MG`%=g|m z^X8k~k$%?3uf-Gvq$zL(_D2#0SnA&Ir+GIGeQ*MDy7OMIZl`tUe%-ORoZP09-57VY z^>HWrN_TVEvg@w4r8{q(TAhfF)^xSzH`-SJuWxWzz25|T$kjIW{JQR}>wj-{>VxFs zy0fagT3uIGU2Q{uQtNoo<>xC=^QmT>KNdB=$Ip*P&F{s0+>4`a;SL+{dQGU2Ks7w9 z-E*PpDfR$$YnTi0f*xE3z4O`2K4|cm3%{+{r-HG19H2EJPUhIVPHxB5c8^fW<0|dw zPuz|NI9K-zI>SaG8lmc)K?be}jnSx#5oE-O(aFo6_P35NK~3`zh7Zs2QPY~d@8T0B zIHGp{gqxyvYbshM7Hyr6oGKMLTh*Ehz7kjZA200f?Nv1oN8V8X;|Uxc+=nXzFX|z_cW`PHdO}F;G?rlctEVydypr0p;!_D9Z`u^oj1C-!V9VI5o19 zlzjDM;$bY)*A?$oFonmyh(B+|?}_-o2jc&<;!j2VzXS0N z9v7iQj!Nx-k9&s#2*lgmjK>f^6~Osk5&H~V0$bS5AVB#tkMA9^L2T{vM@9ZEDh!Ql zfj)zc=IN!65RGeq{yH|o-wB-Wof0zhtXL?idH9|cjX4IH#llZEyIHpL^9*jX;!@?R zX)+74g}hm=uzb06n^jH})!PSG-E&|9YO=Vi}ii-u~k zWee2XhGl>{Q>lQOFBglfgjlI;F%`d&uPT<2Ul8NDlC3V8&_9-T?Lh4`Jcm{1ouz1PIWPm$Xf!k8lWA= oMrRb}(_fzO*&zgV`oTb(^j+&2){pMRc6=@>#ui&lzZ2$v0-T&PfdBvi literal 0 HcmV?d00001 diff --git a/Snake/Deplacement.c b/Snake/Deplacement.c index eae84da..a70ab1e 100644 --- a/Snake/Deplacement.c +++ b/Snake/Deplacement.c @@ -2,6 +2,9 @@ #include #include #include +#include "Chemin.h" +#include "Afficher.h" +#include "ModifTab.h" /*verifie les touches cliquée par le joueur*/ int CliqueTouche(int defaut,int* pause,int* fin){ @@ -29,11 +32,12 @@ int CliqueTouche(int defaut,int* pause,int* fin){ case XK_space: if(*pause==1){ *pause=0; + return defaut; } else if(*pause==0){ *pause=1; + return defaut; } - return defaut; case XK_Escape: *fin=1; return defaut; @@ -43,7 +47,29 @@ int CliqueTouche(int defaut,int* pause,int* fin){ } /*deplacement de la queue du serpent en fonction de la trace laissée par la tete*/ -void DeplacementQueue(int tab[H][L],int* sxmin,int* symin,int* direc){ +void DeplacementQueue(int tab[H][L],int* sxmin,int* symin,int* direc, int menu){ + if(menu==3){ + if(*direc==0){ + *sxmin=*sxmin+1; + *direc=VoirCase(tab,*sxmin,*symin,*direc); + tab[*sxmin][*symin]=40; + } + else if(*direc==1){ + *symin=*symin-1; + *direc=VoirCase(tab,*sxmin,*symin,*direc); + tab[*sxmin][*symin]=40; + } + else if(*direc==2){ + *sxmin=*sxmin-1; + *direc=VoirCase(tab,*sxmin,*symin,*direc); + tab[*sxmin][*symin]=40; + } + else if(*direc==3){ + *symin=*symin+1; + *direc=VoirCase(tab,*sxmin,*symin,*direc); + tab[*sxmin][*symin]=40; + } + }else{ if(*direc==0){ *sxmin=*sxmin+1; *direc=VoirCase(tab,*sxmin,*symin,*direc); @@ -64,11 +90,13 @@ void DeplacementQueue(int tab[H][L],int* sxmin,int* symin,int* direc){ *direc=VoirCase(tab,*sxmin,*symin,*direc); tab[*sxmin][*symin]=0; } + } } /*Deplacement de la tete du seroent en fonction de la direction*/ -void DeplacementTete(int tab[H][L],int* sxmax,int* symax,int direction,int* temoin,int* fin,int* point){ - if(direction==2){ +void DeplacementTete(int tab[H][L],int* sxmax,int* symax,int direction,int* temoin,int* fin,int* point,int mode){ + if(mode==1){ + if(direction==2){ if(VerifChemin(tab,*sxmax-1,*symax)==1){ *sxmax=*sxmax-1; tab[*sxmax][*symax]=1; @@ -152,5 +180,177 @@ void DeplacementTete(int tab[H][L],int* sxmax,int* symax,int direction,int* temo }else{ *fin=1; } + }/*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa*/ + }if(mode==2){ + if(direction==2){ + if(VerifChemin(tab,*sxmax-1,*symax)==1){ + *sxmax=*sxmax-1; + tab[*sxmax][*symax]=1; + }else if(VerifChemin(tab,*sxmax-1,*symax)==3){ + *sxmax=*sxmax-1; + tab[*sxmax][*symax]=1; + *point=*point+5; + DessinerScore(*point); + Pastille(tab,1,1); + *temoin=1; + }else if(VerifChemin(tab,*sxmax-1,*symax)==2){ + *sxmax=*sxmax-1; + tab[*sxmax][*symax]=1; + Pastille(tab,5,3); + Pastille(tab,1,2); + }else{ + *fin=1; + } } + /*droite*/ + if(direction==3){ + if(VerifChemin(tab,*sxmax,*symax+1)==1){ + *symax=*symax+1; + tab[*sxmax][*symax]=1; + }else if(VerifChemin(tab,*sxmax,*symax+1)==3){ + *symax=*symax+1; + tab[*sxmax][*symax]=1; + *point=*point+5; + DessinerScore(*point); + Pastille(tab,1,1); + *temoin=1; + }else if(VerifChemin(tab,*sxmax,*symax+1)==2){ + *symax=*symax+1; + tab[*sxmax][*symax]=1;; + Pastille(tab,5,3); + Pastille(tab,1,2); + }else{ + *fin=1; + } + } + /*gauche*/ + if(direction==1){ + if(VerifChemin(tab,*sxmax,*symax-1)==1){ + *symax=*symax-1; + tab[*sxmax][*symax]=1; + } + else if(VerifChemin(tab,*sxmax,*symax-1)==3){ + *symax=*symax-1; + tab[*sxmax][*symax]=1; + *point=*point+5; + DessinerScore(*point); + Pastille(tab,1,1); + *temoin=1; + }else if(VerifChemin(tab,*sxmax,*symax-1)==2){ + *symax=*symax-1; + tab[*sxmax][*symax]=1;; + Pastille(tab,5,3); + Pastille(tab,1,2); + }else{ + *fin=1; + } + } + /*bas*/ + if(direction==0){ + if(VerifChemin(tab,*sxmax+1,*symax)==1){ + *sxmax=*sxmax+1; + tab[*sxmax][*symax]=1; + } + else if(VerifChemin(tab,*sxmax+1,*symax)==3){ + *sxmax=*sxmax+1; + tab[*sxmax][*symax]=1; + *point=*point+5; + DessinerScore(*point); + Pastille(tab,1,1); + *temoin=1; + }else if(VerifChemin(tab,*sxmax+1,*symax)==2){ + *sxmax=*sxmax+1; + tab[*sxmax][*symax]=1; + Pastille(tab,5,3); + Pastille(tab,1,2); + }else{ + *fin=1; + } +/*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa*/ + }}if(mode==3){ + if(direction==2){ + if(VerifChemin(tab,*sxmax-1,*symax)==1){ + *sxmax=*sxmax-1; + tab[*sxmax][*symax]=1; + }else if(VerifChemin(tab,*sxmax-1,*symax)==3){ + *sxmax=*sxmax-1; + tab[*sxmax][*symax]=1; + *point=*point+5; + DessinerScore(*point); + Pastille(tab,1,1); + *temoin=1; + }else if(VerifChemin(tab,*sxmax-1,*symax)==2){ + *sxmax=*sxmax-1; + tab[*sxmax][*symax]=1; + Pastille(tab,20,3); + Pastille(tab,1,2); + }else{ + *fin=1; + } + } + /*droite*/ + if(direction==3){ + if(VerifChemin(tab,*sxmax,*symax+1)==1){ + *symax=*symax+1; + tab[*sxmax][*symax]=1; + }else if(VerifChemin(tab,*sxmax,*symax+1)==3){ + *symax=*symax+1; + tab[*sxmax][*symax]=1; + *point=*point+5; + DessinerScore(*point); + Pastille(tab,1,1); + *temoin=1; + }else if(VerifChemin(tab,*sxmax,*symax+1)==2){ + *symax=*symax+1; + tab[*sxmax][*symax]=1;; + Pastille(tab,20,3); + Pastille(tab,1,2); + }else{ + *fin=1; + } + } + /*gauche*/ + if(direction==1){ + if(VerifChemin(tab,*sxmax,*symax-1)==1){ + *symax=*symax-1; + tab[*sxmax][*symax]=1; + } + else if(VerifChemin(tab,*sxmax,*symax-1)==3){ + *symax=*symax-1; + tab[*sxmax][*symax]=1; + *point=*point+5; + DessinerScore(*point); + Pastille(tab,1,1); + *temoin=1; + }else if(VerifChemin(tab,*sxmax,*symax-1)==2){ + *symax=*symax-1; + tab[*sxmax][*symax]=1;; + Pastille(tab,20,3); + Pastille(tab,1,2); + }else{ + *fin=1; + } + } + /*bas*/ + if(direction==0){ + if(VerifChemin(tab,*sxmax+1,*symax)==1){ + *sxmax=*sxmax+1; + tab[*sxmax][*symax]=1; + } + else if(VerifChemin(tab,*sxmax+1,*symax)==3){ + *sxmax=*sxmax+1; + tab[*sxmax][*symax]=1; + *point=*point+5; + DessinerScore(*point); + Pastille(tab,1,1); + *temoin=1; + }else if(VerifChemin(tab,*sxmax+1,*symax)==2){ + *sxmax=*sxmax+1; + tab[*sxmax][*symax]=1; + Pastille(tab,20,3); + Pastille(tab,1,2); + }else{ + *fin=1; + } + }} } diff --git a/Snake/Deplacement.h b/Snake/Deplacement.h index 41e94fa..08ec316 100644 --- a/Snake/Deplacement.h +++ b/Snake/Deplacement.h @@ -10,7 +10,7 @@ #define L 62 int CliqueTouche(int defaut, int *pause, int *fin); -void DeplacementQueue(int tab[H][L], int *sxmin, int *symin, int *direc); -void DeplacementTete(int tab[H][L], int *sxmax, int *symax, int direction, int *temoin, int *fin, int *point); +void DeplacementQueue(int tab[H][L], int *sxmin, int *symin, int *direc,int); +void DeplacementTete(int tab[H][L], int *sxmax, int *symax, int direction, int *temoin, int *fin, int *point,int menu); #endif // DEPLACEMENT_H diff --git a/Snake/Deplacement.o b/Snake/Deplacement.o new file mode 100644 index 0000000000000000000000000000000000000000..bec87a9cb90a51276c74d09450cfdc8358a5bc9e GIT binary patch literal 10352 zcmeI1Z)_Ar6u@Wi${(R{C!iKEdKyIta;dZjj!! z)ekqx?#}+^&3kX>&Ca~Ndo{GX!J}zR7L9FV&Yh%;Rp0N_>v*+}En$_cMYn#_d#(no zt|{G0P3l(5_!(>-$CF;W?>b}V5&P=v`-QV+WO2O~ufD!v&YF;I(QEPQ>-&0;^>khG`g(ta{?KzY%|K>;aAt%Gq&3bUEFQ$8R_Y&(tN$&%*Q2X%;W3*&<=xqQCYu^ zvpZv5kZ&tSXGi`}!N}d*y9@f+#N+>N1txnph?Zyxy8CgA=V67f3UHfUcS4x~bmttN zWCn2U&++ZbA}}^$dk5iyAVrvGOif_=5pAcqi$Q?`r%3#>%@GPfGK0 zL4gh^b7VW~>$e8h?tHRkU7%)juqId&*i^k~bM=;*hhSZ;fFl40 z{@w*5%)_)nWU^@D9+P$~Xda99aud@!{o3lv1q)9?=d4~TXXjbz*7E3jQv&{PGx27lP(7jJ=ontUL(jBxHNu-oA9 z=d0j;qr8;kzJuHbh5RGHQT~D$ME)$m8Wi$P3Vu+**$$&47LFKgM!Ok|u=-f^NXpn3 zPeob{+O#)iqzv{{JesHvCv#f%874FsiRj__R--N24!x4eXuFYUj>HoNYYZpNXe?%c zd0tkED?Sb$Q`hYh6B7a%{9c{qzbbeW{(cI@EkCT_kK!CDApe8)b7uO z=jg{9DCj?x4=H#j;Z)CM1>cU&K|%f0&u0jyc8?RDqn~gp|A&GS;s&(FIEr*?M{o}-^| zDnFp$zY|XNG~enx7v*0QPRH{H!l~WA2&a0QmpS^Wd{n_dBAn`}T<++hyn}G+=Ly28 z-OmZ9dMZT%;*RgV3f@9E)pJ(C@5V#`iaYKP6HfgM6P}}=a4P?kf>+$`*rj@2RPYOg z)A1Z5oZ9u@q0mn_mG4&YF9@f8uB#|Y zam(slT;_ELU0mjGESNmnW`+;J)lAseR#{6Jv2f5dI!zXQK5T|r@K7?zf{}O|CTA?z z9yg63 +#include +#include +#include "Menu.h" + +int MenuDebut(void){ + couleur c=CouleurParNom("green"); + ChoisirCouleurDessin(c); + RemplirRectangle(1300,100,300,200); + c=CouleurParNom("purple"); + ChoisirCouleurDessin(c); + RemplirRectangle(1300,400,300,200); + c=CouleurParNom("red"); + ChoisirCouleurDessin(c); + RemplirRectangle(1300,700,300,200); + + + + c=CouleurParNom("white"); + ChoisirCouleurDessin(c); + EcrireTexte(1400,150,"Normal",1); + EcrireTexte(1400,450,"Mirror",1); + EcrireTexte(1400,750,"Hard",1); + EcrireTexte(50,100,"Snake de Maxim Lalane et Raphael Beau",2); + EcrireTexte(200,200,"Choisissez un mode de jeu : ",1); + EcrireTexte(250,250,"-Normal, un jeu snake tout ce qu'il y a de plus basique",1); + EcrireTexte(250,300,"-Mirror, les murs sur les cotes tombent, les boules violettes font leur apparition !",1); + EcrireTexte(250,350,"-Hard, Bon courage !! (vraiment)",1); + EcrireTexte(200,450,"Les regles sont simples :",1); + + + c=CouleurParNom("dark blue"); + ChoisirCouleurDessin(c); + RemplirRectangle(650,483,20,20); + c=CouleurParNom("red"); + ChoisirCouleurDessin(c); + RemplirArc(650,483,20,20,360,360); + + c=CouleurParNom("dark blue"); + ChoisirCouleurDessin(c); + RemplirRectangle(803,582,20,20); + c=CouleurParNom("purple"); + ChoisirCouleurDessin(c); + RemplirArc(803,582,20,20,360,360); + + c=CouleurParNom("dark grey"); + ChoisirCouleurDessin(c); + RemplirRectangle(615,530,20,20); + c=CouleurParNom("black"); + ChoisirCouleurDessin(c); + DessinerRectangle(617,532,16,16); + + c=CouleurParNom("white"); + ChoisirCouleurDessin(c); + EcrireTexte(250,500,"Regle n1-Mangez un maximum de pommes pour grandir",1); + + c=CouleurParNom("white"); + ChoisirCouleurDessin(c); + EcrireTexte(250,550,"Regle n2-Ne vous prennez pas de murs , ou vous perdrez !",1); + + c=CouleurParNom("white"); + ChoisirCouleurDessin(c); + EcrireTexte(250,600,"Regle n3-Malheur a vous si vous prennez une prune surprise .",1); + + c=CouleurParNom("white"); + ChoisirCouleurDessin(c); + EcrireTexte(250,650,"Regle n4-N'oubliez pas de vous amuser ;)",1); + + while(1){ + if(SourisCliquee()==1){ + if(_X>=1300&&_Y>=100&&_X<=1600&&_Y<=300){ + return 1; + } + if(_X>=1300&&_Y>=400&&_X<=1600&&_Y<=600){ + return 2; + } + if(_X>=1300&&_Y>=700&&_X<=1600&&_Y<=900){ + return 3; + } + } + } +} +/*Initialisation de la page*/ +void InitEcran(void){ + InitialiserGraphique(); + CreerFenetre(10,10,1700,1000); + couleur c; + c=CouleurParNom("dark blue"); + ChoisirCouleurDessin(c); + RemplirRectangle(0,0,1700,1000); +} + +void MenuFinPerdu(void){ + couleur c=CouleurParNom("white"); + ChoisirCouleurDessin(c); + EcrireTexte(1350,200,"Dommage !",2); + EcrireTexte(1280,250,"Peut-etre une prochaine fois",2); +} + +void MenuFinGagne(void){ + couleur c=CouleurParNom("white"); + EcrireTexte(1350,200,"Felicitations !",2); + EcrireTexte(1280,200,"Vous etes trop fort !!",2); +} diff --git a/Snake/Menu.h b/Snake/Menu.h new file mode 100644 index 0000000..7aa7e96 --- /dev/null +++ b/Snake/Menu.h @@ -0,0 +1,14 @@ +#ifndef MENU_H +#define MENU_H + +#include +#include +#include +#include + +int MenuDebut(void); +void MenuFinGagne(void); +void MenuFinPerdu(void); +void InitEcran(void); + +#endif // MENU_H diff --git a/Snake/Menu.o b/Snake/Menu.o new file mode 100644 index 0000000000000000000000000000000000000000..9c6e19e4a28e537f3af688e90b40986c1c5b8ebb GIT binary patch literal 6944 zcmbtZU2I%O6`pl|Ow*=zn}|fT4`Zc2iE1x)(n1M8wX=!sKx{0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9z8TaJo=h9&U=WSLeUZ7&keZA% zP6f;Dc?IVR_mvR;gD+St>j=lQhAD9PCWfzOxH~(@Z)bRg_)Z^dEMLkid%n5;*BQ?B zQ-*W>X9#!tw^1MW2Npm6b2)5ruKyatx&F@yclv9oe}VCN{J&y2*Z;kz*7^CA?8P54J!#V#shI9TohI9Ta4CnlxFr4$>VmRmjmf@WL9>Y2R1BP?{MqCUi zXzqZI%R?W-@x9dHj}q?I#oc55jE_ynA7eOQ-+nPGfvI{kAD=lU;u zIwQ1ye#ZEG|GeSxpCJCP3;2KW_%6;XjE_wh=YKrDyWeleprK&?c|02kcX>ET@oXvJ zOB8{EG@{ymzkRlF_kMoJ!`=J#vmWl=w?#QQUQbmO>eS@*lxrCss&Wc1&!Rk`QYFgO zBoSp3=bak<=8nJ?!9N(3;WuMXlH!l`ygvzV@9VQT&pDf_D!3;u>Pvm{;Nfs1c`Ykx(HT z-nh=-kKYXj)Vx{$KJZ0Nz9*pD9RFp{;NnLPme0Tk{d=*)N(a3l-ODg+y7*nagJGQd zkbA-6;4)l%uf_Yp3sdxxzaN($|C6NY`yV3zAA+41-ye73a_fKTn&XN$2m@ zf4SVF%OZ_`i4uj|$=v~Hcm7E8*B /*initialisation du plateau de jeu*/ -void init(int tab[H][L]){ - /*creation de la page*/ - InitialiserGraphique(); - CreerFenetre(10,10,1700,1000); +void init(int tab[H][L], int mode){ int i,j; couleur c; c=CouleurParNom("dark blue"); @@ -16,7 +13,7 @@ void init(int tab[H][L]){ RemplirRectangle(0,0,1700,1000); DessinerScore(0); DessinerTimer(0); - /*initialisation de la grille a 0(vert)*/ + /*initialisation de la grille a 0(noir)*/ for(i=1;i#L2(EecveNo8UGqs5;q7^SkX7hSwtS=b4c42(*I-N|PL+iZN@A{yFr zc#Ol73@?7ad;LEp7&=A*;&c*-@FVQ0Z?D`zHP!g?C z#|U)g;R9bsd8us-1ErHc5c$bC-aF00+v>^Nh&Is;*bM2qZmrK|G8w(rRBNq>_qg`w zx#)(MY*i;(-bQUZq~I+at$V2!(@;xUTi){WvR?a5RqD0Bdb}EGe)3WW)zrcK)`jS% zmpq_8epdG#=&RMpt)=xdORHE(Wno(>jT}RR=k^Bjcc)PiI<8`j6r-pJmxhm*gSA3# z2j7JqIJ5NVpTon44`vK!UY*XCOn~u3;zM<4{BkO)#?EUoEvAl*j-4NUKlUzWLW|&~ z;zfsrEC_+JPM9!-uj!D;UTzPd+?)cXJfIAo>N~N5&esvAi)@Pe;nL}WZ$pXx-ta^S zDa?0)c>(4r*pWY@kUz+X8i79!yZOUizi0qq_B2l`PT}&b#Ah`khA#~aJWXY*a{)MQ zTQ`0(0KXD|8;Daqq7Jqvh+ade&b zI45R~nKd-mEW4o17_I@@bg>AUW49M+JC`%_=*!!#so}f*PSG{e^L#ytFN3p%s74C1`Z1FBp=XGBx+1$mY8 z-{QD04gBo~INzUtgva#LkE@UI{PG!7Dxs%dl+B<219TELDwA;DN1K8szP0UDn@e*M z=VNIuI5fV=^)g0tp%eHNPUyY!*FVJd{<_5e3q5_uD5hV3jq9%oA|L&F>O!K%xnB&c zR1})XPv=kXyU>gC@0Oc%cX<9u{=oDu6Xe%ZO#j&ja`$zwkZu$*gzuS?r HnP2}e+k$46 literal 0 HcmV?d00001 diff --git a/Snake/exec b/Snake/exec new file mode 100755 index 0000000000000000000000000000000000000000..3b3e3fa46512b266625ba9e43cfbaa745b167524 GIT binary patch literal 29320 zcmeHQ3wTu3wcbe>K`TsDv{6yVC!i#Rr}#hM%)8k|~p!cxDFUgNKGx z#`8s~t&iU8y_a6?%YN;pEmnCL0$2mqYlF3jEn-w`XBxDzr8e5g+<)!InKLId5R>cu zzWaUInpu0j_F8+b{WveqS?yjlKQ||bsglR8VT6^OA}A%2F>1N20F&6&kjq#qf)|u8MEs(Nj*E9C*>6+8&sBj5UClAy>h8HYKdsa4mSxhQ&8Ev0eUjj zQsUS^rMW`d%a(@{IX)GX;boHp{;HYNCkJW@1O8yNsjz9*%)*(|i^8EIF;K{_V*JsV z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@8CO9`F2$(lWQ#Gp~Yq7c9DdPU#}=_4DU1 zaaVdPOXnO?(8#UcuEAoxNRhG^5x);x*Z&P?{!Xa-xE_>rXhD<#2&B}e@ zh(ACdsK5swkaC1?fv+w|ABixBN+qrtvn3i`az;B<;jnbm{^1AHx9Q?r4<>HSb81|q zeW=2#1#8T)P>K5iI(>1%t5H;7)b=e2vt@i9BK7sB%7qDK{@FfdPZ)8P5+~Fvy!_ddI^hQmO+-)IMMg90Dj=x5dO6M#rjQHvp7q9n) z>se9F-9eZTFro|23QZ5=0(=_c1y9!kK2ngi#z2G>aW{)1_!bB&;v>395Ag^TY4zS( z-PfRb>uaE^Frne~>ADY&l7_0IVPAv48dgJS3qM8NfM^UUWJT3bOAB z7NTO+e@f~r=u(0b+VyV&{S%z)DF4;@pMn#lo;v@t`|ksv&i$0WIzLp9_DL$_BgI+i ztMf!ZXymfeSLd4ws`E>T@Iq}^%bh^zTu$k$^EUZ}tQ8fCsnS>HrwaB+L3{jE|DTZhbEKR)-&IhZACo?v6WinW9ndHys(o|+l>4Z< z4ge8e?D>BRRI9#A>Y30MaJ4-v_RM$C_yxsqw zOMMl8b^NU0NI4&rzKWm1x7zg8`I~~9l%Rxm`+IEq?MsB9g4;~T1l?}`Hz4C|fX@Mv zP}gtNchBtd3RmzQ=r}F<>iW*^+o`qGcoA3%SNh#x(AZI7Qs<-UJ9cy*lnRZ1DoRh~ z@d#)nqV(1Gf!e(!jr)}Xn7>M2!B4@l>Z|kQxYXZZYKn@|Q;^Q@torJ_dEGK0ul!Wa zC_NL0GSQU(8yW@Y$z=jg5WxI(nKe-vE$tWE=t`f~cWWVEsaT suivant) { - Compteur_Temps++; - DessinerTimer(Compteur_Temps); - suivant = Microsecondes() + DELTA; - } - if (Microsecondes() > suivant3) { - DeplacementQueue(tab, pointeur_sxmin, pointeur_symin, pointeur_direc); - suivant3 = TempsArret(pointeur_temoin); - } - if (Microsecondes() > suivant2) { - DeplacementTete(tab, pointeur_sxmax, pointeur_symax, direction, pointeur_temoin, pointeur_fin, pointeur_point); - suivant2 = Microsecondes() + DELTO; - } - } - if (fin == 1) { - return EXIT_SUCCESS; + if (Microsecondes() > suivant) { + Compteur_Temps++; + DessinerTimer(Compteur_Temps); + suivant = Microsecondes() + DELTA; + } + if (Microsecondes() > suivant3) { + DeplacementQueue(tab, pointeur_sxmin, pointeur_symin, pointeur_direc,mode); + suivant3 = TempsArret(pointeur_temoin); + } + if (Microsecondes() > suivant2) { + DeplacementTete(tab, pointeur_sxmax, pointeur_symax, direction, pointeur_temoin, pointeur_fin, pointeur_point,mode); + suivant2 = Microsecondes() + DELTO; + } } + } + else if (fin == 1) { + if(Gagne(tab)==0){ + MenuFinGagne(); + }else{ + MenuFinPerdu(); + } + } } } diff --git a/Snake/main.o b/Snake/main.o new file mode 100644 index 0000000000000000000000000000000000000000..a8ea7aee0242e87504e3248a1894d1f8f0a27345 GIT binary patch literal 3088 zcmbuAPiP%Q9LHzV#KxL5&mdArk#~utXxF?(u&E;NnWWiDQevB0K}0t%lVmZwFYF&k z1rbSCSeFMq7!RJj>9Gd`Jy>``As#&RP^yRrDF`X_pauQQJc6YEVSA|$*!)%CMv6A1cj~^|aVrq_H1`2FIigW*W9bS}D`8P0~(e8UmA6&NKukZ6edK0n#Qj z4VxhCENQo}tpog61J&0?C>QasG^^u-BS=wv&>R0wSgaR6iAYYmixkmOsuUr)ZzcO; zGL5l~owhM@-K9**c{SS&Nfyz|X%i<%cX6tPG~0Q48!1ZnP$;>2G5PL7(pEkaQNvUu z6keKLr`EJMSn%9VjLaLU805}0vw|#4$2e#(lin6bOPitu>8_|tx+jZ;^VYiCvC^zI zG72RTPPAatBC8`i5B|m>nP**3O-h=6FCW z+QaMQy_@?uA~l!$xD_1}C3^T4O=i+XlGyyr%(?Q!{KYG$%9SazVphs$CeKVwzEpV; zSB6?Y^)mGV>SV_Hn9%}L&5*kKMxT-s#s`;}v0XC8hK>&2pvjZO(a}u0aIAK`^hw{$ z@MD4$|G;lQ`$K$Pd8;EmUWP$38r8UnMQoUQDer)Ee967|cmaQ*fFobM{Jc`Y7Yg|0 z0&W*@zkq*Oz&|VC%>w>K0cWo5cxGJ;Y|*Lvjeyr1-YO5+1b~ubmhTID|yUbmCowHdU1dhl3Wyj?{X>3A%l z|B1$R|MxV0T(f_maov6tZv!>35$ekSn8xv)DL$@o{8KAlCK(N3WGJCCGq~o4_6m)m zpN$(z^7*E1hI~6@=Bgdq%v=cqX4V@nE+I3$M#xQi15XE`U4LKd>t1AT`Hd~^hu4@X zJn)To*L>UMS-k)GTc-6Wb^e{K5<^q(Tc%~UO2&xy4Y{mR*V~eG*p~MQcMBr!B-)8= zV9(MBF4HV2V_qJ}8R@QL_dH4PnK%Eh>npStJ}0T`O|4h|DQZr|SK~RFP_nYY_-TGa zax!oGI&plz|GGn@-;nF``%?Ln?$`V*0Msr8EY yij7ch8ULm{Fy0EF{Cd1a(v+lb`x=iRwXd?F^PA5fzR6ze-;;qhJ1a9Gzy2SAu-z>H literal 0 HcmV?d00001 diff --git a/Snake/makefile b/Snake/makefile index 35a2333..0f8c60c 100644 --- a/Snake/makefile +++ b/Snake/makefile @@ -1,14 +1,20 @@ -exec : ModifTab.o Afficher.o Chemin.o Deplacement.o main.o - gcc -o exec ModifTab.o Afficher.o Chemin.o Deplacement.o main.o -lgraph -run : exec +exec : Chemin.o Deplacement.o Afficher.o ModifTab.o main.o Menu.o + gcc -ansi -o exec Chemin.o Deplacement.o Afficher.o ModifTab.o main.o Menu.o -lgraph +run : exec ./exec -ModifTab.o : ModifTab.c - gcc -c ModifTab.c -lgraph -Afficher.o : Afficher.c - gcc -c Afficher.c -lgraph Chemin.o : Chemin.c gcc -c Chemin.c -lgraph Deplacement.o : Deplacement.c gcc -c Deplacement.c -lgraph +Afficher.o : Afficher.c + gcc -c Afficher.c -lgraph +ModifTab.o : ModifTab.c + gcc -c ModifTab.c -lgraph main.o : main.c gcc -c main.c -lgraph +Menu.o : Menu.c + gcc -c Menu.c -lgraph +clean : + rm -f *~ + rm -f *.o + rm exec