1
0

Intégration du compteur de coups dans fin

This commit is contained in:
Tom MOGULJAK 2022-12-08 09:22:06 +01:00
parent 0fabe562ba
commit 83adc1cadf
3 changed files with 8 additions and 5 deletions

View File

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

View File

@ -4,7 +4,7 @@
#include"../include/main.h"
#include"../include/timer.h"
int fin(unsigned long int timer) {
int fin(unsigned long int timer, int coups) {
zone recommencer = {375, 665, 150, 35};
zone quitter_fin = {735, 665, 100, 35};
@ -23,6 +23,9 @@ int fin(unsigned long int timer) {
snprintf(buf, 100, "Votre temps : %02d:%02d", minutes, secondes);
EcrireTexte(530, 200, buf, 1);
snprintf(buf, 100, "Votre nombre de coups : %d", coups);
EcrireTexte(495, 250, buf, 1);
dessiner_bouton(recommencer, "Recommencer", CouleurParNom("black"), CouleurParNom("dark green"), CouleurParNom("dark green"), 1);
dessiner_bouton(quitter_fin, "QUITTER", CouleurParNom("red"), CouleurParNom("red"), CouleurParNom("white"), 1);

View File

@ -23,7 +23,7 @@ int update_coups(int coups) {
CopierZone(3, 0, 170, 0, 150, 30, 170, 0);
ChoisirEcran(0);
return coups+1;
return coups;
}
int game(int colonnes, int lignes) {
@ -122,7 +122,7 @@ int game(int colonnes, int lignes) {
for (c = 0; c < colonnes; c++) {
if (check_zone(cards[l][c].zone, _X, _Y)) {
cards[l][c] = show_card(cards[l][c]);
coups = update_coups(coups);
coups = update_coups(coups+1);
}
}
}
@ -153,5 +153,5 @@ int game(int colonnes, int lignes) {
}
}
return fin(stop_timer(timer));
return fin(stop_timer(timer), coups);
}