ajout des variables dans jeu.c + modif makefile
This commit is contained in:
parent
e6a058de5d
commit
ccab398cdc
4
Makefile
4
Makefile
@ -3,11 +3,11 @@ CFLAGS= -Wall -c -lgraph
|
|||||||
LDFLAGS= -Wall -lgraph
|
LDFLAGS= -Wall -lgraph
|
||||||
EXEC=menu
|
EXEC=menu
|
||||||
|
|
||||||
jeu: main.o images.o menu.o temps.o
|
jeu: main.o images.o menu.o temps.o jeu.o
|
||||||
$(CC) -o jeu main.o images.o menu.o temps.o $(LDFLAGS)
|
$(CC) -o jeu main.o images.o menu.o temps.o $(LDFLAGS)
|
||||||
main.o: main.c images.h menu.h main.h
|
main.o: main.c images.h menu.h main.h
|
||||||
$(CC) main.c $(CFLAGS)
|
$(CC) main.c $(CFLAGS)
|
||||||
images.o: images.c images.h jeu.h
|
images.o: images.c images.h
|
||||||
$(CC) images.c $(CFLAGS)
|
$(CC) images.c $(CFLAGS)
|
||||||
menu.o: menu.c menu.h
|
menu.o: menu.c menu.h
|
||||||
$(CC) menu.c $(CFLAGS)
|
$(CC) menu.c $(CFLAGS)
|
||||||
|
5
images.c
5
images.c
@ -10,12 +10,11 @@ int tirage_aleatoire(void){
|
|||||||
InitialiserGraphique();
|
InitialiserGraphique();
|
||||||
char tirage[50], affichage[50];
|
char tirage[50], affichage[50];
|
||||||
int pos_x, pos_y, clic_x, clic_y, im_y, im_x;
|
int pos_x, pos_y, clic_x, clic_y, im_y, im_x;
|
||||||
int i, j, g;
|
int i, j;
|
||||||
int nb, score=0;
|
int nb;
|
||||||
int tab[40];
|
int tab[40];
|
||||||
int nb_paires=20;
|
int nb_paires=20;
|
||||||
int positions[20][4];
|
int positions[20][4];
|
||||||
int repet;
|
|
||||||
char* comparer[2];
|
char* comparer[2];
|
||||||
|
|
||||||
ChargerImage("Images/background.png",0,0,0,0,1024,576);
|
ChargerImage("Images/background.png",0,0,0,0,1024,576);
|
||||||
|
7
jeu.c
7
jeu.c
@ -8,9 +8,13 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int jeu(void){
|
int jeu(void){
|
||||||
int temps;
|
int temps,score,repet;
|
||||||
|
int i,j,g;
|
||||||
|
int clic_x,clic_y,im_y,im_x;
|
||||||
|
char tempstab[50];
|
||||||
while(score<20){
|
while(score<20){
|
||||||
temps=timer();
|
temps=timer();
|
||||||
|
snprintf(tempstab,50,"%d secondes écoulées",temps);
|
||||||
for (repet=0;repet<3;repet++){
|
for (repet=0;repet<3;repet++){
|
||||||
if (SourisCliquee()){
|
if (SourisCliquee()){
|
||||||
clic_x=_X;
|
clic_x=_X;
|
||||||
@ -53,4 +57,5 @@ int jeu(void){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return score;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user