diff --git a/test.c b/test.c index 14d12b7..d66688f 100644 --- a/test.c +++ b/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; }