Aggiungi schermata introduttiva alla storia (dopo START, prima del gioco)

Premendo START nel menu titolo appare l'introduzione narrativa:
'You were walking alone in the dead of night. Without warning, an
unnatural darkness consumed the world around you. Your only comfort
is a faint torch. The path behind you is gone. Descend deeper into
the unknown.'

Si chiude con un tasto qualsiasi, poi avvia la partita.
Usa il Window layer come le altre schermate testuali.

Ripristina anche death.c e instructions.c dai commit precedenti.
This commit is contained in:
2026-06-26 12:11:25 +02:00
parent 7757e414a4
commit 220ab389e7
8 changed files with 66 additions and 21 deletions
+17 -8
View File
@@ -20,24 +20,33 @@ void main(void) {
uint8_t keys = joypad();
if (app_state == 0) {
// Schermata crediti attiva: B per tornare al titolo
if (credits_active) {
// Credits: B per tornare al titolo
if ((keys & J_B) && !(prev_keys & J_B)) {
HIDE_WIN;
BGP_REG = 0xE4;
// Ripristina i tile del titolo (font li aveva sovrascritti)
set_bkg_data(0, title_bg_TILE_COUNT, title_bg_tiles);
set_bkg_tiles(0, 0, title_bg_WIDTH / 8, title_bg_HEIGHT / 8, title_bg_map);
credits_active = 0;
}
} else {
title_update(keys, prev_keys);
if ((keys & J_START) && !(prev_keys & J_START)) {
} else if (intro_active) {
// Intro: un tasto qualsiasi avvia la partita
if (keys && !prev_keys) {
HIDE_WIN;
BGP_REG = 0xE4;
app_state = 1;
level = 1; // Nuova partita dal livello 1
level = 1;
intro_active = 0;
engine_init();
}
// SELECT nel titolo: mostra i crediti
} else {
title_update(keys, prev_keys);
// START: mostra l'introduzione alla storia
if ((keys & J_START) && !(prev_keys & J_START)) {
intro_active = 1;
show_intro();
}
// SELECT: mostra i crediti
if ((keys & J_SELECT) && !(prev_keys & J_SELECT)) {
show_credits();
credits_active = 1;
@@ -49,4 +58,4 @@ void main(void) {
prev_keys = keys;
}
}
}