From d7c464fed4849d6aa42fc1d2f280770a8acad64b Mon Sep 17 00:00:00 2001 From: Jason Bou-Samra <154414066+bou-samra@users.noreply.github.com> Date: Wed, 16 Oct 2024 20:12:45 +1100 Subject: [PATCH] Update render.c --- src/render.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/render.c b/src/render.c index 1437796..07e54d6 100644 --- a/src/render.c +++ b/src/render.c @@ -64,9 +64,9 @@ int Ren_level(void) { for (int i = 0; i < 2; i++) { status[21 + i] = str[i]; } - hts(level_c, str); // level current + its(level_c, str); // level current for (int i = 0; i < 2; i++) { - status[26 + i] = str[i]; + status[26 + i] = str[5 + i]; } its(total, str); // total bricks smashed for (int i = 0; i < 7; i++) { @@ -115,12 +115,28 @@ int Ren_high(void) { SDL_RenderDrawLine(sr, 91, 195, 91, 10); // update status panel - for (int i = 0; i < 7; i++) { - high[14 + i] = name_temp[i]; +// for (int i = 0; i < 7; i++) { +// high[14 + i] = name_temp[i]; +// } +// its(score, str); // score +// for (int i = 0; i < 7; i++) { +// high[21 + i] = str[i]; +// } + + +// print hscores + for (int i = 0; i < 8; i++) { + for (int j = 0; j < 7; j++) { + high[21 + (i * 14) + j] = hscores[i][j]; + } } - its(score, str); // score - for (int i = 0; i < 7; i++) { - high[21 + i] = str[i]; + + +// print hall of fame names + for (int i = 0; i < 8; i++) { + for (int j = 0; j < 7; j++) { + high[14 + (i * 14) + j] = names[i][j]; + } } @@ -250,7 +266,7 @@ int game_logic(void) { display_grid(); SDL_RenderPresent (sr); } - + score = score + 5; col = new_column(); if (col == -1) { return 0;