ajout de l'écran de fin du jeu
This commit is contained in:
@@ -6,20 +6,24 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <graph.h>
|
||||
#include "ecran_fin.h"
|
||||
|
||||
|
||||
|
||||
void ecran_fin(short int* compteur, unsigned char minutes, unsigned char secondes) {
|
||||
|
||||
int main(void) {
|
||||
|
||||
couleur grey, green, yellow, red, black;
|
||||
|
||||
|
||||
InitialiserGraphique();
|
||||
|
||||
|
||||
CreerFenetre(400,150,650,500);
|
||||
couleur grey, white, red;
|
||||
|
||||
char comp[10];
|
||||
|
||||
char min[5];
|
||||
char sec[5];
|
||||
|
||||
int touche;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -27,40 +31,60 @@ couleur grey, green, yellow, red, black;
|
||||
grey = CouleurParComposante(60, 60, 60);
|
||||
ChoisirCouleurDessin(grey);
|
||||
|
||||
RemplirRectangle(0,0,650,500);
|
||||
RemplirRectangle(400,150,650,500);
|
||||
|
||||
red = CouleurParComposante(255,0,0);
|
||||
ChoisirCouleurDessin(red);
|
||||
|
||||
EcrireTexte(280,50, "DEAD", 2);
|
||||
EcrireTexte(680,250, "DEAD", 2);
|
||||
|
||||
EcrireTexte(90,370, "space = play", 2);
|
||||
EcrireTexte(490,370, "espace = rejouer", 2);
|
||||
|
||||
EcrireTexte(400,370, "echap = quit", 2);
|
||||
EcrireTexte(800,370, "echap = quitter", 2);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
yellow = CouleurParComposante(255,255,0);
|
||||
ChoisirCouleurDessin(yellow);
|
||||
white = CouleurParComposante(255,255,255);
|
||||
ChoisirCouleurDessin(white);
|
||||
|
||||
EcrireTexte(20,200, "score : ", 2);
|
||||
EcrireTexte(420,500, "Votre score : ", 2);
|
||||
|
||||
EcrireTexte(20,250, " time : ", 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);
|
||||
|
||||
sprintf( sec, "%hhd", secondes);
|
||||
|
||||
EcrireTexte( 920, 500, sec, 2);
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
ajout_score();
|
||||
time()
|
||||
*/
|
||||
|
||||
Touche();
|
||||
FermerGraphique();
|
||||
free(compteur);
|
||||
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
touche = Touche();
|
||||
|
||||
if ( touche == XK_Escape ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( touche == XK_space) {
|
||||
|
||||
main();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user