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.
SELECT nel menu titolo mostra i crediti: titolo, autore (Matteo B.),
strumenti (GBDK 2020, SDCC SM83, PyBoy). B per tornare al titolo.
Usa il Window layer (come le istruzioni) per non corrompere il BG map.
Ricrea i file src/screens/ rimossi da make clean (death.c,
instructions.c, screens.c) e aggiunge credits.c.
Ogni schermata testuale (font IBM) ora vive in un file separato nella
sottocartella src/screens/:
- screens.h: dichiarazioni + helper (ending_puttext/putdigit)
- screens.c: implementazione degli helper condivisi
- instructions.c: schermata istruzioni (Window layer)
- death.c: schermata di sconfitta (game_over==1)
- going_deeper.c: transizione livello (game_over==2)
- finale.c: finale tragico (game_over==3, spoiler)
engine.c ora chiama show_instructions(), show_death(),
show_going_deeper(), show_finale() invece di avere il codice inline.
Il titolo resta un'immagine (title_bg.png), non testuale.
Schermata istruzioni mostrata all'inizio del livello 1, chiudibile con B,
ri-apribile in gioco con SELECT. Testo con font IBM (stesso pattern del
finale game_over==3 e della sconfitta game_over==1).
Contenuto: titolo, obiettivo (find the hatch), controlli (DPAD walk,
A jump abyss, B run), istruzioni di chiusura (press B, select help).
Per fare spazio: rimosso claimed.png (schermata di morte ora testuale
con lo stesso font, stesso pattern del finale).
- assets/claimed.png (160x144, 2-bit GB) usata come schermata di morte al
posto dello schermo nero. Il tile data e' caricato con set_bkg_data
e la mappa 20x18 con set_bkg_tiles; il GAME OVER metasprite resta
sovrapposto sopra l'immagine.
- Going Deeper (game_over==2) ora usa una schermata testuale col font
IBM ('GOING DEEPER / LEVEL N') invece dell'immagine next_level.png.
Necessario per ridurre l'occupazione ROM (la ROM era >32KB con
title_bg + next_level + claimed + maze + tutto il resto) e far
entrare la schermata claimed. Rimosso next_level.c/.h e l'asset.
- engine.c: nuovi helper ending_putdigit per scrivere una cifra;
game_over==2/3 entrambi usano il font IBM per le schermate di
transizione.
- Makefile: rimosso next_level da SRCS e dal clean; aggiunto
claimed.png/png2asset/-c claimed.c.
Verificato via PyBoy: schermata di morte mostra l'immagine claimed
(sfondo nero + carta 128x96 centrata), going deeper mostra il testo
'GOING DEEPER / LEVEL 2'.
build/test_finale.gb mostra immediatamente la schermata finale (testo
tragico + musica del finale su tutti e 3 i canali) all'avvio, senza
dover completare gli 8 livelli. Premi START per uscire.
- src/test_finale_render.c: setup palette invertita, font IBM,
scrittura del messaggio nel map_buffer, init audio + VBL +
game_over=3/timer=0 per far partire il sequencer del finale.
- Makefile: nuovo target build/test_finale.gb (aggiunto ad all).
Run (B + direction):
- player_logic.c: while holding B + direction with stamina >= 10, each tile
takes 8 frames instead of 16 (move_progress += 2, LERP >>4 unchanged) and
costs 10 stamina per tile. DAS_REPEAT_RUN=2 chains tiles fluidly.
- Falls back silently to normal walk when stamina < 10.
Level progression:
- New global 'level' (starts at 1). title->game resets to 1; reaching the
hatch (victory/Going Deeper) + START increments before engine_init (new
maze); defeat + START resets to 1.
- Top-left HUD 'L<n>' via 3 sprites (OAM 23-25) from new level.png asset
(glyphs L, 0-9), generated by scripts/generate_level.py and converted
with png2asset -keep_duplicate_tiles for predictable tile ordering.
- VRAM base aligned to an EVEN index (8x16 hardware ignores tile LSB) and
placed after the stamina load claim to avoid the shared BG tile block.
- update_level_display() called every frame; hides during game over/title.
Docs: README, doc/gameplay.md and the technical report updated.