1
0

modification fichier fin.c et ajout fichier fin.h

This commit is contained in:
Tom MOGULJAK 2022-11-25 15:57:46 +01:00
parent 281ac81a98
commit 8c4945750c
2 changed files with 22 additions and 5 deletions

6
include/fin.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef FIN_H
#define FIN_H
void fin(unsigned long int timer);
#endif

View File

@ -1,17 +1,28 @@
#include<stdio.h> #include<stdio.h>
#include<stdlib.h> #include<stdlib.h>
#include<graph.h> #include<graph.h>
#include"../include/main.h"
#include"../include/timer.h"
int main() { void fin(unsigned long int timer) {
Zone Recommencer = {375, 665, 150, 35}; Zone Recommencer = {375, 665, 150, 35};
Zone Quitterfin = {735, 665, 100, 35}; Zone Quitterfin = {735, 665, 100, 35};
ChargerImage("./../img/backgrounds/peeposhy.png", 225, 100, 0, 0, 800, 550); ChargerImage("./../img/backgrounds/peeposhy.png", 225, 100, 0, 0, 800, 550);
ChoisirCouleurDessin("black"); ChoisirCouleurDessin(CouleurParNom("black"));
EcrireTexte(550, 150, "You Win !", 2); EcrireTexte(550, 150, "You Win !", 2);
snprintf(buf, 100, "Votre temps : %02d:%02d", minute, seconde);
char buf[100];
timer = stop_timer(timer);
unsigned int secondes = timer / DELTA;
unsigned int minutes = 0;
while (secondes >= 60) {
minutes += 1;
secondes -= 60;
}
snprintf(buf, 100, "Votre temps : %02d:%02d", minutes, secondes);
EcrireTexte(530, 200, buf, 1); EcrireTexte(530, 200, buf, 1);
dessinerbouton(Recommencer, "Recommencer", CouleurParNom("black"), CouleurParNom("dark green"), CouleurParNom("dark green"), 1); dessinerbouton(Recommencer, "Recommencer", CouleurParNom("black"), CouleurParNom("dark green"), CouleurParNom("dark green"), 1);
@ -23,7 +34,7 @@ int main() {
if(SourisCliquee()) { if(SourisCliquee()) {
if(checkzone(Quitterfin, _X, _Y)) if(checkzone(Quitterfin, _X, _Y))
boucle = 0; Touche();
} }
} }