Création d'un mode triche on/off
This commit is contained in:
parent
deed4ef7a3
commit
33fd06032a
22
test.c
22
test.c
@ -4,15 +4,29 @@
|
|||||||
|
|
||||||
int main(void){
|
int main(void){
|
||||||
int i,j;
|
int i,j;
|
||||||
|
int x=1;
|
||||||
|
int touche;
|
||||||
InitialiserGraphique();
|
InitialiserGraphique();
|
||||||
CreerFenetre(10,10,1000,1000);
|
CreerFenetre(10,10,1000,1000);
|
||||||
ChoisirCouleurDessin(CouleurParComposante(255,0,0));
|
ChoisirCouleurDessin(CouleurParComposante(255,0,0));
|
||||||
for (i=1;i<6;i+=1){
|
while(1){
|
||||||
for (j=1;j<6;j+=1){
|
if (ToucheEnAttente()){
|
||||||
RemplirRectangle(i*100,j*100,50,50);
|
touche = Touche();
|
||||||
|
if (touche == XK_t)
|
||||||
|
x = -x;
|
||||||
|
if (x==-1){
|
||||||
|
EffacerEcran(CouleurParComposante(255,255,255));
|
||||||
|
ChoisirCouleurDessin(CouleurParComposante(255,0,0));
|
||||||
|
EcrireTexte(10,10,"mode triche",2);
|
||||||
|
}
|
||||||
|
if (x==1){
|
||||||
|
EffacerEcran(CouleurParComposante(255,255,255));
|
||||||
|
|
||||||
|
}
|
||||||
|
if (touche == XK_space)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Touche();
|
|
||||||
FermerGraphique();
|
FermerGraphique();
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user