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 i,j;
|
||||
int x=1;
|
||||
int touche;
|
||||
InitialiserGraphique();
|
||||
CreerFenetre(10,10,1000,1000);
|
||||
ChoisirCouleurDessin(CouleurParComposante(255,0,0));
|
||||
for (i=1;i<6;i+=1){
|
||||
for (j=1;j<6;j+=1){
|
||||
RemplirRectangle(i*100,j*100,50,50);
|
||||
while(1){
|
||||
if (ToucheEnAttente()){
|
||||
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();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user