MAJ
This commit is contained in:
@@ -5,13 +5,12 @@
|
|||||||
#include "../include/jeu.h"
|
#include "../include/jeu.h"
|
||||||
#include "../include/jeu_humain.h"
|
#include "../include/jeu_humain.h"
|
||||||
|
|
||||||
#define DELAI_MS 100
|
|
||||||
|
|
||||||
|
void attendre(int secondes) {
|
||||||
|
time_t start_time = time(NULL);
|
||||||
|
|
||||||
void attendre(int delai_ms) {
|
while(difftime(time(NULL), start_time) < secondes) {
|
||||||
clock_t start_time = clock();
|
break;
|
||||||
while (((clock() - start_time) * 1000) / CLOCKS_PER_SEC < delai_ms) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,12 +26,12 @@ void jouerModeHumain(struct EtatJeu *etatJeu) {
|
|||||||
if (etatJeu->phase > 0 && !peutDeplacer(*etatJeu, etatJeu->tourJoueur)) {
|
if (etatJeu->phase > 0 && !peutDeplacer(*etatJeu, etatJeu->tourJoueur)) {
|
||||||
afficherVictoire(etatJeu->tourJoueur == 1 ? 2 : 1);
|
afficherVictoire(etatJeu->tourJoueur == 1 ? 2 : 1);
|
||||||
while (!SourisCliquee()) {
|
while (!SourisCliquee()) {
|
||||||
attendre(DELAI_MS);
|
attendre(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
attendre(DELAI_MS);
|
attendre(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user