The maze side length is now a runtime global 'map_size' (MAP_SIZE=7 at
level 1, +2 per level, capped at MAX_MAP_SIZE=17), while the maze array
is allocated with the MAX_MAP_SIZE bound. All modules (maze DFS, fog
rendering, player/enemy bounds, hatch and enemy-spawn placement) now use
map_size at runtime.
- globals: maze[MAX_MAP_SIZE][MAX_MAP_SIZE], map_size global, MAX_MAP_SIZE=17.
- maze.c: DFS on map_size; stack/valid arrays made static (WRAM) and sized
for the max maze to avoid hardware-stack overflow; hatch min distance
scales with map_size/2.
- engine.c: sets map_size from level before generate_maze; enemy spawn min
distance scales with map_size/2.
- render.c: flush the full 32x32 background map (the old rows 2-17
optimization broke for large mazes where the 5x5 fog window wraps outside
that range); dynamic bounds; signed/unsigned casts.
- player_logic/enemy_logic: dynamic map_size bounds.
Verified via PyBoy: sizes 7,9,11,13,15,17,17 across levels 1-7, each with
a hatch; rendering and movement intact at 17x17 and at 7x7.
The victory hatch (maze[y][x]==2) is now chosen among all walkable cells
at Chebyshev distance >= MIN_GOAL_DIST (3) from the player start (1,1),
instead of being constrained to the bottom row. This lets the goal appear
anywhere in the maze while always staying far from the start.
- maze.c: collect all floor cells with chebyshev(1,1) >= 3 and pick one
at random; fallback to the farthest floor cell if none qualifies.
- doc/generation.md + report: document the new placement rule.
- Add doc/AScreamFromTheDark_report.md: deep technical report covering
architecture, features, historical workarounds and known debt.
- Rewrite README.md to reflect the current 'A Scream from the Dark'
identity (ghost enemy, stamina/jump, fog of war, going-deeper victory)
instead of the stale 'gioco carino' copy with old file paths.
- Update doc/generation.md: goal is now a random south-edge hatch,
not the max-Manhattan-distance portal.
- Remove orphaned src/victory.{c,h} and its include in render.c;
the victory sequence was replaced by the full-screen next_level image.
- Regenerate tracked png2asset outputs to match current build.