Hitscreen gets updated after Player input and before win check

This commit is contained in:
2017-05-24 15:47:25 +02:00
parent 874367f321
commit dd28f75813

View File

@@ -104,12 +104,11 @@ void startGame(game_state *gs, hitfeed *hf) {
time(&gs->startTime); time(&gs->startTime);
while (checkWin(gs)) { while (checkWin(gs)) {
updateScreen(gs); updateScreen(gs);
printHitFeed(gs, hf);
playerInput(gs, hf); playerInput(gs, hf);
printHitFeed(gs, hf);
} }
} }
void quitProgram(void) { void quitProgram(void) {
endwin(); endwin();
} }
@@ -456,11 +455,14 @@ void printHitFeed(game_state *gs, hitfeed *hf) {
mvprintw(newMaxy + i, newMaxx, hf->history[i]); mvprintw(newMaxy + i, newMaxx, hf->history[i]);
} }
/* Print best score above history feed */ /* Print best score above history feed */
if (hf->besthit != 0) {
/* There is a hit. So a best score can be displayed */
char message[100]; char message[100];
sprintf(message, "Best: %s (%i hits)", hf->beststreak, hf->besthit); sprintf(message, "Best: %s (%i hits)", hf->beststreak, hf->besthit);
mvprintw(newMaxy - 1, newMaxx, message); mvprintw(newMaxy - 1, newMaxx, message);
} }
} }
}