une paire complétée ne peut plus être retournée une autre fois (mais est masquée)
This commit is contained in:
parent
f989b0ba97
commit
876eb37217
18
jeu.c
18
jeu.c
@ -13,9 +13,8 @@ int jeu(int position[20][4], int nb_paires){
|
|||||||
int repet2, nb_images;
|
int repet2, nb_images;
|
||||||
int clic_x,clic_y,im_y,im_x;
|
int clic_x,clic_y,im_y,im_x;
|
||||||
unsigned long temps, temps2,temps3;
|
unsigned long temps, temps2,temps3;
|
||||||
char tempstab[50],affichage[50];;
|
char tempstab[50],affichage[50];
|
||||||
char* comparer1[50], comparer2[50];
|
int tab[3], ban_list[20];
|
||||||
int tab[3];
|
|
||||||
couleur c=CouleurParComposante(0,0,0);
|
couleur c=CouleurParComposante(0,0,0);
|
||||||
temps2=Microsecondes();
|
temps2=Microsecondes();
|
||||||
|
|
||||||
@ -80,14 +79,14 @@ int jeu(int position[20][4], int nb_paires){
|
|||||||
if (position[i][(j*2)]==im_x && position[i][(j*2+1)]==im_y){
|
if (position[i][(j*2)]==im_x && position[i][(j*2+1)]==im_y){
|
||||||
if (repet==0){
|
if (repet==0){
|
||||||
g=i+1;
|
g=i+1;
|
||||||
snprintf(comparer1,50,"Images/image%d.png",g);
|
snprintf(affichage,50,"Images/image%d.png",g);
|
||||||
ChargerImage(comparer1,im_x,im_y,0,0,80,80);
|
ChargerImage(affichage,im_x,im_y,0,0,80,80);
|
||||||
stock_g_1=g;
|
stock_g_1=g;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
g=i+1;
|
g=i+1;
|
||||||
snprintf(comparer2,50,"Images/image%d.png",g);
|
snprintf(affichage,50,"Images/image%d.png",g);
|
||||||
ChargerImage(comparer2,im_x,im_y,0,0,80,80);
|
ChargerImage(affichage,im_x,im_y,0,0,80,80);
|
||||||
stock_g_2=g;
|
stock_g_2=g;
|
||||||
}
|
}
|
||||||
repet++;
|
repet++;
|
||||||
@ -101,6 +100,10 @@ int jeu(int position[20][4], int nb_paires){
|
|||||||
printf("%d\n", im_y);*/
|
printf("%d\n", im_y);*/
|
||||||
if (stock_g_1==stock_g_2){
|
if (stock_g_1==stock_g_2){
|
||||||
score++;
|
score++;
|
||||||
|
position[stock_g_1-1][0]=0;
|
||||||
|
position[stock_g_1-1][1]=0;
|
||||||
|
position[stock_g_1-1][2]=0;
|
||||||
|
position[stock_g_1-1][3]=0;
|
||||||
}
|
}
|
||||||
repet2=0;
|
repet2=0;
|
||||||
if (score!=nb_paires){
|
if (score!=nb_paires){
|
||||||
@ -117,7 +120,6 @@ int jeu(int position[20][4], int nb_paires){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Touche();
|
|
||||||
FermerGraphique();
|
FermerGraphique();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user