Correction Affichage, Ajout Best Score par lecture de ficheirs

This commit is contained in:
Vincent
2023-12-23 16:00:48 +01:00
parent 7afb378891
commit c5b8ea1870
11 changed files with 98 additions and 26 deletions

16
main.c
View File

@@ -14,7 +14,6 @@ int main()
{
unsigned char pause = 0;
unsigned long score = 0;
unsigned long bestscore = 0;
unsigned long suivant;
unsigned long suivant2;
int game_on=0;
@@ -57,11 +56,8 @@ int main()
while(window_on)
{
if(perdu == 1)
{ if(score>bestscore)
{
bestscore=score;
}
PerduGUI(&bestscore);
{
PerduGUI();
if (ToucheEnAttente() == 1)
{
switch (Touche())
@@ -74,7 +70,7 @@ int main()
}
else
{
Menu(&bestscore);
Menu();
if (ToucheEnAttente() == 1)
{
switch (Touche())
@@ -93,6 +89,7 @@ int main()
case XK_Escape:
free(serpent);
free(pastilles);
free(obstacle);
FermerGraphique();
return EXIT_SUCCESS;
}
@@ -148,6 +145,7 @@ int main()
{
free(serpent);
free(pastilles);
free(obstacle);
FermerGraphique();
return EXIT_SUCCESS;
}
@@ -157,7 +155,7 @@ int main()
if(pause==1)
{
Pause(&bestscore);
Pause();
}
}
@@ -189,6 +187,7 @@ int main()
}
else if (valeur_retourne == 2)
{
CheckScore(score);
perdu=1;
game_on=0;
}
@@ -199,6 +198,7 @@ int main()
}
free(serpent);
free(pastilles);
free(obstacle);
FermerGraphique();
return EXIT_SUCCESS;
}