aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-06-29 22:10:43 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-06-29 22:10:43 +0100
commit10f11bb551897abc5f6978b3a6ee1b373b9341d2 (patch)
treedc7cc3fe7a2becfbcc2da70f85977c075cde38e8 /src
parent2d2379251e71b5f315235db7980d0cfe03132561 (diff)
downloadgold-mine-run-10f11bb551897abc5f6978b3a6ee1b373b9341d2.tar.gz
gold-mine-run-10f11bb551897abc5f6978b3a6ee1b373b9341d2.zip
Add "Ready?" text to the start of stage
Diffstat (limited to 'src')
-rw-r--r--src/game.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/game.c b/src/game.c
index 64a7b23..4441cf0 100644
--- a/src/game.c
+++ b/src/game.c
@@ -41,6 +41,13 @@ static uint8_t time;
static uint8_t pickaxe;
static uint8_t gameover;
+static void wait_time(uint16_t frames)
+{
+ /* wait some time */
+ for (uint16_t i = 0; i < frames; i++)
+ wait_vsync();
+}
+
static void hud_render()
{
char b[32];
@@ -109,8 +116,7 @@ static void run_gameover()
blit_update();
/* wait some time */
- for (uint8_t i = 0; i < 255; i++)
- wait_vsync();
+ wait_time(255);
}
void run_game()
@@ -126,8 +132,22 @@ void run_game()
blit_erase(0);
map_init(binary_stage_start);
+
+ /* render the scene with the READY? text */
map_render();
+ entities_draw();
+ player_draw();
+ hud_render();
+ put_text(136, 100, "READY?", 1);
+
+ wait_vsync();
+ blit_update();
+
+ /* wait some time */
+ wait_time(96);
+ /* erase the READY? text */
+ map_render();
entities_draw();
player_draw();