From 751404655a3fedf12c4bc988fd89bf43940e5852 Mon Sep 17 00:00:00 2001 From: elsyspedromamede Date: Mon, 29 Oct 2018 15:47:10 -0300 Subject: [PATCH] Update the Hi Score and Score at the same time when you hit the Hi Score --- src/gfx_curses.c | 3 +++ src/gfx_terminal.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/gfx_curses.c b/src/gfx_curses.c index 4db2467..cf53e9a 100644 --- a/src/gfx_curses.c +++ b/src/gfx_curses.c @@ -65,6 +65,9 @@ void gfx_draw(struct gfx_state *s, struct gamestate *g) else 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); wattron(s->window, A_DIM); diff --git a/src/gfx_terminal.c b/src/gfx_terminal.c index ec2de50..e243d0c 100644 --- a/src/gfx_terminal.c +++ b/src/gfx_terminal.c @@ -41,6 +41,9 @@ void gfx_draw(struct gfx_state *s, struct gamestate *g) else printf("Score: %ld\n", g->score); + if (g->score >= g->score_high) + g->score_high = g->score; + printf(" Hi: %ld\n", g->score_high); iterate((g->print_width + 2) * g->opts->grid_width + 1, printf("-")); printf("\n");