Debug view improvements, warp animation

* Add a visible frame one tile beyond the normal screen in debug mode.

* Fix the display of motion paths for mounted traps in debug mode.

* Add an animation for the warp trap.
This commit is contained in:
James Campbell
2026-07-22 11:56:21 -04:00
parent d84e4627c3
commit 59e4bcce1c
8 changed files with 249 additions and 41 deletions

20
SPEC.md
View File

@@ -40,8 +40,9 @@ labeled colored rectangle, so the game is fully playable with zero assets.
cell's pixel rect is `(col*tile, row*tile, tile, tile)`.
- Y increases downward (screen convention).
- The window is sized **once** at startup to fit the tallest and widest level
(plus a HUD band of 46 px on top; minimum window width 480 px). It is never
resized afterward — recreating the display mid-session makes the OS window
(plus a HUD band of 46 px on top; minimum window width 480 px; plus the debug
overscan margin of §14 for any level shown in debug). It is never resized
afterward — recreating the display mid-session makes the OS window
flicker/close. Each level's play area is a surface of its own pixel size,
centered within the fixed window below the HUD; smaller levels are
letterboxed with a dark background.
@@ -388,7 +389,10 @@ blocks: `type: block, invisible: true, count: [w, h]`.)
### 13.4 `warp`
An invisible tile that teleports the player to `to: [col, row]` on contact
(zeroing velocity). It re-arms only once the player has left the tile, so it
fires once per entry.
fires once per entry. On activation a brief **aura** flashes at both the source
and destination tiles and fades out over ~0.35 s (expanding/thinning rings drawn
procedurally, no sprite), so the teleport reads on screen even though the tile
itself is invisible.
### 13.5 `phase_block`
Invisible and intangible until its `trigger` fires, then it fades into a solid
@@ -414,7 +418,15 @@ levels) reveals everything normally hidden:
- fake blocks tinted, invisible walls tinted, warps tinted with a line to their
destination, dormant phase blocks ghosted, not-yet-sprung spikes marked,
- crumbled-away blocks shown as ghosts,
- moving blocks draw their travel path (waypoints + connecting lines).
- moving blocks draw their travel path (waypoints + connecting lines),
- an **overscan margin** of `DEBUG_VIEW_MARGIN` tiles (default 1) is revealed on
every side, so geometry just off the map — e.g. an invisible catch-wall a step
off-screen — is visible instead of clipped. The play surface is enlarged and
all drawing is shifted into it (`Level.render_offset`, a draw-only translation;
physics stays in true coordinates). The off-map region is shaded, its grid
labels run negative / past the map, and the **true runtime viewport is
outlined** so it's clear what's actually on screen during play. The window is
sized at startup to include this margin for any level shown in debug.
---