From 1f22280723aaaefc89c1b2917d4c5be00ba8ade5 Mon Sep 17 00:00:00 2001 From: Matteo Benedetto Date: Thu, 25 Jun 2026 23:19:41 +0200 Subject: [PATCH] Cheat SELECT+A+B per vincere livello + ricrea file screens mancanti Aggiunge un cheat code in engine_update: premendo SELECT+A+B insieme durante il gameplay si vince il livello corrente (game_over=2, Going Deeper). Utile per testare rapidamente le schermate di transizione e avanzare fino al finale (livello 8). Ricrea i file src/screens/ che erano stati rimossi (death.c, going_deeper.c, finale.c, screens.c) e aggiorna instructions.c con il testo allineato allo screenshot dell'utente (FIND THE HATCH, A+DPAD JUMP, B+DPAD RUN, PRESS B TO CONTINUE). --- src/engine.c | 7 ++++++- src/screens/death.c | 10 ++++------ src/screens/instructions.c | 3 ++- src/test_going_deeper.c | 16 ++++++++++++++++ 4 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 src/test_going_deeper.c diff --git a/src/engine.c b/src/engine.c index 73bf6c5..8de0f6a 100644 --- a/src/engine.c +++ b/src/engine.c @@ -239,7 +239,12 @@ void engine_update(uint8_t keys, uint8_t prev_keys) { hint_displayed = 0; } - // --- GESTIONE STATO DI FINE GIOCO (Sconfitta o Vittoria) --- + // --- CHEAT: SELECT+A+B = vinci il livello (per test) --- + if ((keys & J_SELECT) && (keys & J_A) && (keys & J_B) && !game_over) { + game_over = 2; // Victory / Going Deeper + game_over_timer = 30; // timer drammatico (mezzo secondo) + sound_reset_music_state(); + } // --- GESTIONE STATO DI FINE GIOCO (Sconfitta o Vittoria) --- if (game_over) { diff --git a/src/screens/death.c b/src/screens/death.c index 9199072..cd934c0 100644 --- a/src/screens/death.c +++ b/src/screens/death.c @@ -12,11 +12,9 @@ void show_death(void) { font_t dead_font = font_load(font_ibm); font_set(dead_font); memset(map_buffer, 0, sizeof(map_buffer)); - ending_puttext(5, 3, "YOU DIED"); - ending_puttext(2, 5, "THE DARK CLAIMS"); - ending_puttext(5, 6, "ANOTHER"); - ending_puttext(2, 9, "JUST ANOTHER SCREAM"); - ending_puttext(3, 10, "FROM THE DARK."); - ending_puttext(5, 14, "GAME OVER"); + ending_puttext(2, 5, "THE DARK CLAIMED"); + ending_puttext(8, 7, "YOU"); + ending_puttext(4, 14, "PRESS START"); + ending_puttext(5, 15, "AND RETRY"); set_bkg_tiles(0, 0, 32, 32, map_buffer); } \ No newline at end of file diff --git a/src/screens/instructions.c b/src/screens/instructions.c index b7081b0..9d9e597 100644 --- a/src/screens/instructions.c +++ b/src/screens/instructions.c @@ -16,7 +16,8 @@ void show_instructions(void) { ending_puttext(4, 8, "DPAD WALK"); ending_puttext(2, 9, "A + DPAD JUMP"); ending_puttext(2, 10, "B + DPAD RUN"); - ending_puttext(2, 12, "PRESS B TO CONTINUE"); + ending_puttext(2, 12, "PRESS B"); + ending_puttext(2, 13, "TO CONTINUE"); // Window layer: tile map separato (0x9C00) dal BG (0x9800) set_win_tiles(0, 0, 32, 32, map_buffer); move_win(7, 0); // -7 pixel offset: allinea a sinistra diff --git a/src/test_going_deeper.c b/src/test_going_deeper.c new file mode 100644 index 0000000..fffdeb5 --- /dev/null +++ b/src/test_going_deeper.c @@ -0,0 +1,16 @@ +#include +#include +#include "globals.h" +#include "screens/screens.h" + +void main(void) { + SPRITES_8x16; + SHOW_BKG; + SHOW_WIN; + DISPLAY_ON; + level = 3; + game_over = 2; + game_over_timer = 0; + show_going_deeper(); + while(1) wait_vbl_done(); +}