diff --git a/Images/FIN.png b/Images/FIN.png index 2456963..f5c5378 100644 Binary files a/Images/FIN.png and b/Images/FIN.png differ diff --git a/Images/score.png b/Images/score.png new file mode 100644 index 0000000..754522f Binary files /dev/null and b/Images/score.png differ diff --git a/Makefile b/Makefile index c6a41c9..d2b9ec9 100644 --- a/Makefile +++ b/Makefile @@ -13,4 +13,5 @@ menu.o: menu.c menu.h $(CC) menu.c $(CFLAGS) jeu.o: jeu.c jeu.h images.h $(CC) jeu.c $(CFLAGS) -run:./jeu \ No newline at end of file +run: + ./jeu \ No newline at end of file diff --git a/images.c b/images.c index 9884956..8abbfb1 100644 --- a/images.c +++ b/images.c @@ -58,10 +58,7 @@ int tirage_aleatoire(int nb_paires){ positions[tab[i]][2]=pos_x; positions[tab[i]][3]=pos_y; } - /*Triche - snprintf(tirage,50,"Images/image%d.png",(tab[i]+1)); - ChargerImage(tirage,pos_x,pos_y,0,0,80,80);*/ - + /*j'ai mis la triche dans le jeu.c*/ ChargerImage("Images/image0.png",pos_x,pos_y,0,0,80,80); i++; @@ -81,7 +78,7 @@ int tirage_aleatoire(int nb_paires){ } printf("\n"); }*/ - score=jeu(positions, nb_paires); + score=jeu(positions, nb_paires,tab); Touche(); FermerGraphique(); printf("\n"); diff --git a/jeu.c b/jeu.c index 3ff7e9b..c0faf96 100644 --- a/jeu.c +++ b/jeu.c @@ -6,24 +6,28 @@ #include "jeu.h" #include -int jeu(int position[20][4], int nb_paires){ - int score=0,repet,test=0; +int jeu(int position[20][4], int nb_paires,int tab[40]){ + int score=0,score2,repet,test=0; int pos_x,pos_y; - int i,j,g, stock_g_1, stock_g_2; + int i,j,g,n=0,x=0, stock_g_1, stock_g_2; int repet2, nb_images; int clic_x,clic_y,im_y,im_x; - unsigned long temps, temps2,temps3; - char tempstab[50],affichage[50];; + unsigned long temps, temps2,temps3=1; + char tempstab[50],affichage[50],scoretab[50]; char* comparer1[50], comparer2[50]; - int tab[3]; couleur c=CouleurParComposante(0,0,0); temps2=Microsecondes(); - + ChargerImage("./Images/score.png",760,250,0,0,224,63); printf("Voici le nombre de paires: %d\n", nb_paires); nb_images=nb_paires*2; score=0; + c=CouleurParComposante(255,255,255); ChoisirCouleurDessin(c); + RemplirRectangle(850,320,50,50); + snprintf(scoretab,50,"%d",score); + c=CouleurParComposante(0,0,0); + ChoisirCouleurDessin(c); + EcrireTexte(865,360,scoretab,2); while(score