Préparations Initialisation Serpent + Améliorations gen_pastille()

This commit is contained in:
XERTAY
2023-11-22 23:41:55 +01:00
parent 4851a7a4d9
commit 321e7af676
6 changed files with 123 additions and 7 deletions

50
Test_Touches.c Normal file
View File

@@ -0,0 +1,50 @@
#include <stdlib.h>
#include <stdio.h>
#include <graph.h>
#define delta 1000000L
int main(void)
{
unsigned long suivant;
int go_on=1;
int n;
InitialiserGraphique();
CreerFenetre(0,0,800,500);
while(go_on)
{
if (ToucheEnAttente() == 1)
{
switch (Touche())
{
case XK_Up:
printf("Touche haut\n");
break;
case XK_Down:
printf("Touche bas\n");
break;
case XK_Left:
printf("Touche gauche\n");
break;
case XK_Right:
printf("Touche droite\n");
break;
default:
printf("Autre touche\n");
break;
}
}
else
{
if (Microsecondes()>suivant)
{
n++;
suivant=Microsecondes()+delta;
}
}
}
return EXIT_SUCCESS;
}