tout va bien mais le score ne s'incrémente pas quand il faut
This commit is contained in:
parent
919a0dda6a
commit
13d939a379
5
images.c
5
images.c
@ -47,6 +47,7 @@ int tirage_aleatoire(int nb_paires){
|
||||
for (pos_y=10;pos_y<=370;pos_y=pos_y+90){
|
||||
for (pos_x=10;pos_x<=640;pos_x=pos_x+90){
|
||||
if (tab[i]==-1){
|
||||
pos_x=650;
|
||||
pos_y=1000;
|
||||
}
|
||||
if (positions[tab[i]][0]==0){
|
||||
@ -67,8 +68,8 @@ int tirage_aleatoire(int nb_paires){
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
for (i=0;i<19;i++){
|
||||
|
||||
/*for (i=0;i<19;i++){
|
||||
printf("%03d", i);
|
||||
printf(" ");
|
||||
}
|
||||
|
13
jeu.c
13
jeu.c
@ -14,7 +14,7 @@ int jeu(int position[20][4], int nb_paires){
|
||||
int clic_x,clic_y,im_y,im_x;
|
||||
unsigned long temps, temps2,temps3;
|
||||
char tempstab[50],affichage[50];;
|
||||
char* comparer[2];
|
||||
char* comparer[200];
|
||||
int tab[3];
|
||||
couleur c=CouleurParComposante(0,0,0);
|
||||
temps2=Microsecondes();
|
||||
@ -71,10 +71,14 @@ int jeu(int position[20][4], int nb_paires){
|
||||
snprintf(affichage,50,"Images/image%d.png",g);
|
||||
printf("Voici repet: %d\n", repet);
|
||||
printf("Voici affichage: %s\n", affichage);
|
||||
comparer[repet]=affichage;
|
||||
if (repet==0){
|
||||
comparer[repet]=affichage;
|
||||
}
|
||||
printf("Voici comparer[repet]: %s\n", comparer[repet]);
|
||||
printf("Voici comparer[0]: %s\n", comparer[0]);
|
||||
printf("Voici comparer[1]: %s\n\n", comparer[1]);
|
||||
ChargerImage(affichage,im_x,im_y,0,0,80,80);
|
||||
printf("Voici repet: %d après\n", repet);
|
||||
repet++;
|
||||
}
|
||||
}
|
||||
@ -86,7 +90,7 @@ int jeu(int position[20][4], int nb_paires){
|
||||
printf("Voici comparer[1]: %s\n", comparer[1]);
|
||||
/*printf("%d\n", im_x);
|
||||
printf("%d\n", im_y);*/
|
||||
if (comparer[0]==comparer[1]){
|
||||
if (comparer[0]==affichage){
|
||||
score++;
|
||||
}
|
||||
repet2=0;
|
||||
@ -104,6 +108,7 @@ int jeu(int position[20][4], int nb_paires){
|
||||
}
|
||||
}
|
||||
}
|
||||
FermerGraphique();
|
||||
Touche();
|
||||
FermerGraphique();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Loading…
Reference in New Issue
Block a user