Evita che le istruzioni riappaiano ripetendo il livello 1

Aggiunge hint_shown_once: le istruzioni appaiono solo la prima volta
che si gioca il livello 1. Se il giocatore muore e riprova, o torna al
titolo e ricomincia, le istruzioni non si rimostrano.
SELECT in gioco rimane disponibile per rivederle quando si vuole.
This commit is contained in:
2026-06-26 12:24:04 +02:00
parent f0a4647752
commit de55ba092e
3 changed files with 7 additions and 1 deletions
+3 -1
View File
@@ -73,7 +73,8 @@ void engine_init(void) {
// la ROM a 32KB e' piena e il linker potrebbe troncare la coda). // la ROM a 32KB e' piena e il linker potrebbe troncare la coda).
hint_active = 0; hint_active = 0;
hint_displayed = 0; hint_displayed = 0;
if (level == 1) hint_active = 1; // Mostra le istruzioni SOLO la prima volta che si gioca il livello 1
if (level == 1 && !hint_shown_once) hint_active = 1;
// Carica il font testuale di sistema (IBM) // Carica il font testuale di sistema (IBM)
font_init(); font_init();
@@ -212,6 +213,7 @@ void engine_update(uint8_t keys, uint8_t prev_keys) {
if (hint_active) { if (hint_active) {
if (!hint_displayed) { if (!hint_displayed) {
hint_displayed = 1; hint_displayed = 1;
hint_shown_once = 1; // segna che le istruzioni sono state mostrate
show_instructions(); show_instructions();
} }
// B chiude la schermata e riprende il gioco // B chiude la schermata e riprende il gioco
+1
View File
@@ -47,5 +47,6 @@ int16_t enemy_target_px[MAX_ENEMIES], enemy_target_py[MAX_ENEMIES];
uint8_t enemy_cooldown[MAX_ENEMIES] = {0}; uint8_t enemy_cooldown[MAX_ENEMIES] = {0};
volatile uint8_t hint_active = 0; volatile uint8_t hint_active = 0;
volatile uint8_t hint_displayed = 0; volatile uint8_t hint_displayed = 0;
volatile uint8_t hint_shown_once = 0;
volatile uint8_t credits_active = 0; volatile uint8_t credits_active = 0;
volatile uint8_t intro_active = 0; volatile uint8_t intro_active = 0;
+3
View File
@@ -81,6 +81,9 @@ extern uint8_t enemy_cooldown[MAX_ENEMIES];
// hint_displayed: 1 = la schermata e' gia' stata renderizzata questo frame. // hint_displayed: 1 = la schermata e' gia' stata renderizzata questo frame.
extern volatile uint8_t hint_active; extern volatile uint8_t hint_active;
extern volatile uint8_t hint_displayed; extern volatile uint8_t hint_displayed;
// hint_shown_once: 1 = le istruzioni sono gia' state mostrate una volta
// (evita che riappaiano ripetendo il livello 1)
extern volatile uint8_t hint_shown_once;
// --- Credits Screen --- // --- Credits Screen ---
// credits_active: 1 = mostra la schermata crediti (SELECT nel menu titolo) // credits_active: 1 = mostra la schermata crediti (SELECT nel menu titolo)