94 lines
1.2 KiB
C
Raw Normal View History

2023-12-19 17:31:26 +01:00
/* Fonction qui affiche l'écran de fin du jeu
Written by Yann KERAUDREN and Titouan LERICHE */
#include <stdlib.h>
#include <stdio.h>
2023-12-24 20:21:24 +01:00
#include "ecran_fin.h"
2023-12-19 17:31:26 +01:00
2023-12-24 20:21:24 +01:00
void ecran_fin(short int* compteur, unsigned char minutes, unsigned char secondes) {
2023-12-19 17:31:26 +01:00
2023-12-24 20:21:24 +01:00
couleur grey, white, red;
2023-12-19 17:31:26 +01:00
2023-12-24 20:21:24 +01:00
char comp[10];
char min[5];
char sec[5];
int touche;
2023-12-19 17:31:26 +01:00
2023-12-20 11:34:42 +01:00
grey = CouleurParComposante(60, 60, 60);
ChoisirCouleurDessin(grey);
2023-12-19 17:31:26 +01:00
2023-12-24 20:21:24 +01:00
RemplirRectangle(400,150,650,500);
2023-12-19 17:31:26 +01:00
2023-12-20 11:34:42 +01:00
red = CouleurParComposante(255,0,0);
ChoisirCouleurDessin(red);
2023-12-19 17:31:26 +01:00
2023-12-24 20:21:24 +01:00
EcrireTexte(680,250, "DEAD", 2);
2023-12-19 17:31:26 +01:00
2023-12-24 20:21:24 +01:00
EcrireTexte(490,370, "espace = rejouer", 2);
2023-12-20 11:34:42 +01:00
2023-12-24 20:21:24 +01:00
EcrireTexte(800,370, "echap = quitter", 2);
2023-12-19 17:31:26 +01:00
2023-12-20 11:34:42 +01:00
2023-12-19 17:31:26 +01:00
2023-12-24 20:21:24 +01:00
white = CouleurParComposante(255,255,255);
ChoisirCouleurDessin(white);
EcrireTexte(420,500, "Votre score : ", 2);
sprintf(comp, "%hd", *compteur);
EcrireTexte( 620, 500, comp, 2);
EcrireTexte(750,500, "Temps ", 2);
sprintf(min, "%hhd", minutes);
EcrireTexte (875, 500, min, 2);
EcrireTexte (900, 500, ":", 2);
2023-12-19 17:31:26 +01:00
2023-12-24 20:21:24 +01:00
sprintf( sec, "%hhd", secondes);
2023-12-19 17:31:26 +01:00
2023-12-24 20:21:24 +01:00
EcrireTexte( 920, 500, sec, 2);
2023-12-19 17:31:26 +01:00
2023-12-20 11:34:42 +01:00
2023-12-19 17:31:26 +01:00
2023-12-24 20:21:24 +01:00
free(compteur);
touche = Touche();
if ( touche == XK_Escape ) {
return;
}
2023-12-19 17:31:26 +01:00
2023-12-24 20:21:24 +01:00
if ( touche == XK_space) {
2023-12-19 17:31:26 +01:00
2023-12-24 23:23:19 +01:00
FermerGraphique();
2023-12-24 20:21:24 +01:00
main();
2023-12-19 17:31:26 +01:00
2023-12-24 20:21:24 +01:00
}
2023-12-19 17:31:26 +01:00
}