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