diff --git a/main.c b/main.c index af0bf85..4298896 100644 --- a/main.c +++ b/main.c @@ -16,9 +16,10 @@ #define delta 100000L -void Affichertimer(int n) /*Afficher le temps passé*/ +void Affichertimeretscore(int n,int score) /*Afficher le temps passé et le score*/ { char buf[100]; + char buff[100]; couleur j; j=CouleurParNom("yellow"); ChoisirCouleurDessin(j); @@ -26,9 +27,9 @@ void Affichertimer(int n) /*Afficher le temps passé*/ ChoisirEcran(1); CopierZone(2,1,0,0,930,710,0,0); snprintf(buf,100,"temps : %05d",n); - TailleSupPolice(7); + snprintf(buff,100,"SCORE : %07d",score); EcrireTexte(60,650,buf,2); - TailleSupPolice(7); + EcrireTexte(600,650,buff,2); CopierZone(1,0,0,0,930,710,0,0); } @@ -191,6 +192,7 @@ void InitialisationDuSerpent(int *p_serpent) /* L'initialisation du serpent */ int main() { + int score =0; unsigned long suivant; int go_on=1; int x_pastille,y_pastille; @@ -246,9 +248,11 @@ int main() if (Microsecondes()>suivant) { n++; - Affichertimer(n); + Affichertimeretscore(n,score); + suivant=Microsecondes()+delta; DeplacementSerpent(direction,serpent,longueur_serpent); + } } diff --git a/prog b/prog index d6a6b8e..cae38a1 100755 Binary files a/prog and b/prog differ