diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-06-29 22:10:43 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-06-29 22:10:43 +0100 |
commit | 10f11bb551897abc5f6978b3a6ee1b373b9341d2 (patch) | |
tree | dc7cc3fe7a2becfbcc2da70f85977c075cde38e8 /src | |
parent | 2d2379251e71b5f315235db7980d0cfe03132561 (diff) | |
download | gold-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.c | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -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(); |