aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-08-03 21:07:51 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-08-03 21:07:51 +0100
commit7ca15b440f10c87fac1b9c7bbbbbcad1edfc4ffd (patch)
tree9be6c2fde68391c7eb7236d0c660169848158420 /src
parent3c1a224d37eae97de7d1562ab280343352f925fe (diff)
downloadgold-mine-run-7ca15b440f10c87fac1b9c7bbbbbcad1edfc4ffd.tar.gz
gold-mine-run-7ca15b440f10c87fac1b9c7bbbbbcad1edfc4ffd.zip
Improved ready and stage clear transitions
Diffstat (limited to 'src')
-rw-r--r--src/game.c46
1 files changed, 20 insertions, 26 deletions
diff --git a/src/game.c b/src/game.c
index d440cb8..8f97a3b 100644
--- a/src/game.c
+++ b/src/game.c
@@ -225,9 +225,17 @@ static uint8_t run_gameover()
static void run_stageclear()
{
+ blit_target(TARGET_BUFFER);
+ blit_erase(0);
+
+ hud = HUD_ALL;
+ hud_render();
+ put_text(116, 90, "STAGE", 1);
+ put_text(164, 90, "CLEAR", 1);
+
wait_vsync();
- put_text(116, 100, "STAGE", 1);
- put_text(164, 100, "CLEAR", 1);
+ blit_copy_all();
+ blit_target(TARGET_SCREEN);
sound_music_pattern(PAT_STAGE);
@@ -249,16 +257,6 @@ static void run_stageclear()
/* wait some time */
wait_frames(64);
-
- wait_vsync();
- blit_erase(0);
-
- /* restore the HUD after erasing the screen */
- hud = HUD_ALL;
- wait_vsync();
- hud_render();
-
- wait_frames(32);
}
void run_game()
@@ -290,31 +288,27 @@ next_stage:
blit_target(TARGET_BUFFER);
blit_erase(0);
- map_init(stages[stage]);
-
- map_render();
hud_render();
+ put_text(136, 90, "READY?", 1);
wait_vsync();
blit_copy_all();
- entities_sort();
+ sound_music_pattern(PAT_READY);
- blit_target(TARGET_SCREEN);
- wait_vsync();
+ /* wait some time */
+ wait_frames(164);
- entities_draw();
- put_text(136, 100, "READY?", 1);
+ map_init(stages[stage]);
+ map_render();
- sound_music_pattern(PAT_READY);
+ entities_sort();
- /* wait some time */
- wait_frames(128);
+ wait_vsync();
+ blit_copy_all();
- /* erase the READY? text */
- Rect ready = { 136, 100, 184, 8 };
+ blit_target(TARGET_SCREEN);
wait_vsync();
- blit_copy(&ready);
entities_draw();
timer_start(GAME_TIME_MAX, &clock_updated);