diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-08-03 21:17:14 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-08-03 21:17:14 +0100 |
commit | 2e80842ed08d6f11df2ab8118099a938d7e52f60 (patch) | |
tree | 839fcfed66a6eef4def0de9310cd17000c3500db | |
parent | 7ca15b440f10c87fac1b9c7bbbbbcad1edfc4ffd (diff) | |
download | gold-mine-run-2e80842ed08d6f11df2ab8118099a938d7e52f60.tar.gz gold-mine-run-2e80842ed08d6f11df2ab8118099a938d7e52f60.zip |
Start game effect, avoid overcopying
-rw-r--r-- | src/menu.c | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -3,6 +3,7 @@ #include "keyb.h" #include "vga.h" +#include "sound.h" #include "text.h" #include "data.h" #include "game.h" @@ -77,18 +78,30 @@ uint8_t run_menu() uint8_t cast = 0; uint8_t wait; - blit_target(TARGET_BUFFER); + blit_target(TARGET_SCREEN); while (1) { if (keys[KEY_ESC]) return 0; if (keys[KEY_SPACE]) + { + sound_play_efx(EFX_ONEUP); + + for (uint8_t i = 0; i < 32; i++) + { + put_text(84, 110, "PRESS SPACE TO PLAY", i & 2 ? 5 : 0); + wait_vsync(); + } + wait_frames(96); + return 1; + } /* change of screen, requires drawing */ if (count == 0) { + blit_target(TARGET_BUFFER); blit_erase(0); render_hiscore(); @@ -102,6 +115,7 @@ uint8_t run_menu() wait_vsync(); blit_copy_all(); + blit_target(TARGET_SCREEN); } /* if is not cast, we do the "blink" effect */ @@ -114,9 +128,7 @@ uint8_t run_menu() wait = 0; put_text(84, 110, "PRESS SPACE TO PLAY", wait ? 0 : 1); - wait_vsync(); - blit_copy_all(); } } |