amelioration de pause
This commit is contained in:
parent
1abeb4cc0b
commit
cb38e83c36
26
main.c
26
main.c
@ -195,7 +195,8 @@ void InitialisationDuSerpent(int *p_serpent) /* L'initialisation du serpent */
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
unsigned char pause = 0;
|
||||
int score =0;
|
||||
unsigned long suivant;
|
||||
int go_on=1;
|
||||
@ -243,11 +244,15 @@ int main()
|
||||
direction = 2;
|
||||
break;
|
||||
case XK_space:
|
||||
switch (Touche())
|
||||
{
|
||||
case XK_space:
|
||||
break;
|
||||
if(pause == 0)
|
||||
{
|
||||
pause = 1 ;
|
||||
}
|
||||
else if(pause == 1)
|
||||
{
|
||||
pause = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
default:
|
||||
@ -256,9 +261,10 @@ int main()
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Microsecondes()>suivant)
|
||||
{
|
||||
{ if(pause==0){
|
||||
|
||||
if (Microsecondes()>suivant)
|
||||
{
|
||||
n++;
|
||||
if(n%60==0)
|
||||
{
|
||||
@ -270,7 +276,9 @@ int main()
|
||||
DeplacementSerpent(direction,serpent,longueur_serpent);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
BIN
prog
BIN
prog
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user