diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-06-21 22:47:49 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-06-21 22:47:49 +0100 |
commit | ba2a2dbe3434a1ffc10542ca38e6116c0bde7b65 (patch) | |
tree | c97712775a6111b5ffc81bf222a6c03a14f6fc61 | |
parent | 03d0053c9531c3f545025654d14541f8a89ce2f7 (diff) | |
download | gold-mine-run-ba2a2dbe3434a1ffc10542ca38e6116c0bde7b65.tar.gz gold-mine-run-ba2a2dbe3434a1ffc10542ca38e6116c0bde7b65.zip |
Add hiscore to the menu screen
-rw-r--r-- | src/game.c | 5 | ||||
-rw-r--r-- | src/game.h | 1 | ||||
-rw-r--r-- | src/menu.c | 7 |
3 files changed, 12 insertions, 1 deletions
@@ -118,3 +118,8 @@ void add_score(uint8_t v) score += v; hud |= HUD_SCORE; } + +uint32_t get_hiscore() +{ + return hiscore; +} @@ -14,5 +14,6 @@ void run_game(); void add_score(uint8_t v); +uint32_t get_hiscore(); #endif /* _GAME_H */ @@ -1,15 +1,20 @@ #include <stdint.h> +#include <stdio.h> #include "keyb.h" #include "vga.h" #include "text.h" #include "data.h" +#include "game.h" uint8_t run_menu() { + char b[10]; + blit_erase(0); - put_text(124, 10, "HI 000000", 5); + sprintf(b, "HI %06li", get_hiscore()); + put_text(124, 10, b, 5); Rect dst = { 80, 45, 160, 38 }; blit(binary_title_start, &dst); |