aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-08-03 21:17:14 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-08-03 21:17:14 +0100
commit2e80842ed08d6f11df2ab8118099a938d7e52f60 (patch)
tree839fcfed66a6eef4def0de9310cd17000c3500db /src
parent7ca15b440f10c87fac1b9c7bbbbbcad1edfc4ffd (diff)
downloadgold-mine-run-2e80842ed08d6f11df2ab8118099a938d7e52f60.tar.gz
gold-mine-run-2e80842ed08d6f11df2ab8118099a938d7e52f60.zip
Start game effect, avoid overcopying
Diffstat (limited to 'src')
-rw-r--r--src/menu.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/menu.c b/src/menu.c
index c3f39a9..77b9f2b 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -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();
}
}