diff --git a/gui.c b/gui.c index f887ed0..91a87db 100644 --- a/gui.c +++ b/gui.c @@ -2,20 +2,35 @@ #include <stdio.h> #include <graph.h> -void Menu() +void Menu(unsigned long *bestscore) { + char buf[100]; + couleur text; + text=CouleurParComposante(78, 93, 47); ChoisirEcran(0); ChargerImage("./images/Menu.png",0,0,0,0,930,710); + ChoisirCouleurDessin(text); + snprintf(buf,100,"BEST SCORE : %07ld",*bestscore); + EcrireTexte(450,470,buf,2); } -void Pause() -{ +void Pause(unsigned long *bestscore) +{ + char buf[100]; + couleur text; + text=CouleurParComposante(78, 93, 47); ChoisirEcran(0); ChargerImage("./images/Pause.png",0,0,0,0,930,710); + ChoisirCouleurDessin(text); + snprintf(buf,100,"BEST SCORE : %07ld",*bestscore); + EcrireTexte(450,300,buf,2); } -void PerduGUI() +void PerduGUI(unsigned long *bestscore) { + char buf[100]; ChoisirEcran(0); - ChargerImage("./images/Perdu.png",0,0,0,0,930,710); + ChargerImage("./images/Perdu.png",0,0,0,0,930,710); + snprintf(buf,100,"SCORE : %07ld",*bestscore); + EcrireTexte(450,250,buf,2); } \ No newline at end of file diff --git a/gui.h b/gui.h index 007bbaf..f121cad 100644 --- a/gui.h +++ b/gui.h @@ -1,9 +1,9 @@ #ifndef GUI_H #define GUI_H -void Menu(); -void PerduGUI(); -void Pause(); +void Menu(unsigned long *bestscore); +void PerduGUI(unsigned long *bestscore) +;void Pause(unsigned long *bestscore); void Reinitialiser(); int AfficherGUI(unsigned char menu); diff --git a/main.c b/main.c index 6c51310..7aef171 100644 --- a/main.c +++ b/main.c @@ -14,6 +14,7 @@ int main() { unsigned char pause = 0; unsigned long score = 0; + unsigned long bestscore = 0; unsigned long suivant; unsigned long suivant2; int game_on=0; @@ -48,8 +49,11 @@ int main() while(window_on) { if(perdu == 1) - { - PerduGUI(); + { if(score>bestscore) + { + bestscore=score; + } + PerduGUI(&bestscore); if (ToucheEnAttente() == 1) { switch (Touche()) @@ -62,7 +66,7 @@ int main() } else { - Menu(); + Menu(&bestscore); if (ToucheEnAttente() == 1) { switch (Touche()) @@ -145,7 +149,7 @@ int main() if(pause==1) { - Pause(); + Pause(&bestscore); } } diff --git a/prog b/prog index 4303411..3a2dd5e 100755 Binary files a/prog and b/prog differ