Update the Hi Score and Score at the same time when you hit the Hi Score
This commit is contained in:
parent
eaca6e1445
commit
751404655a
|
@ -65,6 +65,9 @@ void gfx_draw(struct gfx_state *s, struct gamestate *g)
|
||||||
else
|
else
|
||||||
mvwprintw(s->window, 0, 0, "Score: %d\n", g->score);
|
mvwprintw(s->window, 0, 0, "Score: %d\n", g->score);
|
||||||
|
|
||||||
|
if (g->score >= g->score_high)
|
||||||
|
g->score_high = g->score;
|
||||||
|
|
||||||
mvwprintw(s->window, 1, 0, " Hi: %d\n", g->score_high);
|
mvwprintw(s->window, 1, 0, " Hi: %d\n", g->score_high);
|
||||||
|
|
||||||
wattron(s->window, A_DIM);
|
wattron(s->window, A_DIM);
|
||||||
|
|
|
@ -41,6 +41,9 @@ void gfx_draw(struct gfx_state *s, struct gamestate *g)
|
||||||
else
|
else
|
||||||
printf("Score: %ld\n", g->score);
|
printf("Score: %ld\n", g->score);
|
||||||
|
|
||||||
|
if (g->score >= g->score_high)
|
||||||
|
g->score_high = g->score;
|
||||||
|
|
||||||
printf(" Hi: %ld\n", g->score_high);
|
printf(" Hi: %ld\n", g->score_high);
|
||||||
|
|
||||||
iterate((g->print_width + 2) * g->opts->grid_width + 1, printf("-")); printf("\n");
|
iterate((g->print_width + 2) * g->opts->grid_width + 1, printf("-")); printf("\n");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user