Update hiscore.c

This commit is contained in:
Jason Bou-Samra
2024-10-31 18:58:32 +11:00
committed by GitHub
parent 70721148bd
commit 6c428adb50
+5 -6
View File
@@ -16,9 +16,9 @@ SDL_Rect cursor_last = {128, 146, 7, 5}; // last cursor position
SDL_Rect fnt = {128, 146, 7, 5}; // Name entry cursor SDL_Rect fnt = {128, 146, 7, 5}; // Name entry cursor
char pen1 = 0xff; char pen1 = 0xff;
int score; // current score int score = 0x00; // current score
char level_r = 0x1E; // game level (remaining) char level_r = 0x00; // game level (remaining)
char level_c = 0x00; // game level (current) char level_c = 0x01; // game level (current)
int total = 0x00; // smashed tiles int total = 0x00; // smashed tiles
int total_c = 0x00; // total count int total_c = 0x00; // total count
@@ -36,6 +36,7 @@ int Ren_restart(void) {
Ren_line(gameo, gameol[z][0], gameol[z][1], z * 9, 9, 1); Ren_line(gameo, gameol[z][0], gameol[z][1], z * 9, 9, 1);
} }
SDL_RenderPresent(sr); SDL_RenderPresent(sr);
check_key();
return 0; return 0;
} }
@@ -171,16 +172,14 @@ int end_game(void) {
if (game_end == 1) { // restart if (game_end == 1) { // restart
Ren_restart(); // Ren_restart(); Ren_restart(); // Ren_restart();
check_key();
} else if (game_end == 2) { // game over } else if (game_end == 2) { // game over
if (score < hscores1[7]) { if (score < hscores1[7]) {
Ren_restart(); // if score less then lowest on list, no name entry Ren_restart(); // if score less then lowest on list, no name entry
check_key();
} else { } else {
Ren_gameover(); Ren_gameover();
insert_score(score); // else display name entry dialog insert_score(score); // else display name entry dialog
} }
} }
reset(); // reset();
return 0; return 0;
} }