tout fonctionne. On a fini.

This commit is contained in:
proal 2022-12-04 17:36:36 +01:00
parent 8f6268ef3b
commit 985a9e81da
3 changed files with 14 additions and 4 deletions

14
cheat.c
View File

@ -3,8 +3,9 @@
#include <graph.h> #include <graph.h>
#include "cheat.h" #include "cheat.h"
int cheat(int affichage[50],int tab[40]){ int cheat(int affichage[50],int tab[40], int sauv_pos[40]){
int x,n,pos_x,pos_y; int x,n,pos_x,pos_y;
int i, oui;
while(n<1){ while(n<1){
x=0; x=0;
for (pos_y=10;pos_y<=370;pos_y=pos_y+90){ for (pos_y=10;pos_y<=370;pos_y=pos_y+90){
@ -26,7 +27,16 @@ int cheat(int affichage[50],int tab[40]){
pos_x=650; pos_x=650;
pos_y=1000; pos_y=1000;
} }
ChargerImage("Images/image0.png",pos_x,pos_y,0,0,80,80); oui=0;
for (i=0;i<40;i++){
if (sauv_pos[i]==pos_x && sauv_pos[i+1]==pos_y){
oui=1;
}
}
if (oui==0){
ChargerImage("Images/image0.png",pos_x,pos_y,0,0,80,80);
}
x++; x++;
} }
} }

View File

@ -1,6 +1,6 @@
#ifndef CHEAT_H #ifndef CHEAT_H
#define CHEAT_H #define CHEAT_H
int cheat(int affichage[50],int tab[40]); int cheat(int affichage[50],int tab[40], int sauv_pos[40]);
#endif #endif

2
jeu.c
View File

@ -65,7 +65,7 @@ int jeu(int position[20][4], int nb_paires,int tab[40]){
/*Triche*/ /*Triche*/
if(ToucheEnAttente() && Touche()==XK_t){ if(ToucheEnAttente() && Touche()==XK_t){
n=cheat(affichage,tab); n=cheat(affichage,tab, sauv_pos);
} }
/*Clic de la souris*/ /*Clic de la souris*/