Skip to content

fix(engine): Climb the Dock's side instead of walking behind it - #181

Merged
omesser merged 1 commit into
mainfrom
fix/dock-side-is-a-wall
Sep 2, 2026
Merged

omesser merged 1 commit into
mainfrom
fix/dock-side-is-a-wall

Conversation

@omesser

@omesser omesser commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

Why

A walk along the display floor beside the Dock carried on under it. #145 gave the Dock its true bounds and dropped the floor beside it to the display's real bottom, so the floor runs under the Dock; the Engine treats the Dock as a surface to stand on and never as an obstacle, so nothing stopped horizontal travel there. The sprite ended up behind the Dock, where it can be neither seen nor grabbed. #145 named this as the limitation it left behind.

What

The Dock's side is a wall, and the wall is climbed onto the Dock's top — a Perch the sprite already knows how to stand on.

  • dock_side_reached (in engine/geometry.rs) finds a sprite the Dock hides and names the nearer side to stand clear of. The Engine recognises the Dock by its Perch's reserved id, the one thing it now knows about the Dock.
  • The wall stands half a sprite (EDGE_CLEARANCE) out from the Dock's own edge, because a sprite centred on that edge is already half hidden. Strictly inside that line, so the sprite this places is beside the Dock and stays there: the walk stops going forward instead of being set back, which is the fix(engine): A walk is not stationary, so the edge inset leaves it alone #141 stutter it must not repeat.
  • Hidden means hidden by the Dock's own display. A display stacked below shares the Dock's x-range, and a sprite on that floor is behind none of it; the Dock's centre says which display owns it, the way window_source::centered_in does. The display's bottom is the lower bound, not the Dock's, because the real Dock stops short of the floor the sprite walks on.
  • A grounded walk that reaches the line is placed on it with its velocity zeroed and reports Contact::Wall, so the existing transition makes it Climbing. A fall that arrives behind the Dock — a low throw, or letting go with the cursor over it — catches the same side, through the same or_else on wall_reached.
  • A climb whose feet reach the Dock's top edge lands there (Contact::Landed(Perch)) instead of carrying on to the ceiling, and steps half a sprite in from the corner it climbed, so the whole sprite is on the Dock and perch_at agrees that is where it stands.

Climb rather than turn: the Dock's side is the same shape of problem as a display edge, and the top is a surface the sprite already stands on, so nothing new is owed by any Character. A drop from above onto the Dock's top is untouched and still lands normally, because the Falling branch tests the pre-step y and such a sprite is never below the top. Also untouched: a sprite already on the Dock's top, a hidden or side Dock (already modelled as absent), and every world without a Dock — the display-edge climb is unchanged.

How to test

  • A walk into the Dock climbs onto it rather than going behind it: never occupies the Dock's x-range below its top, never moves back against its travel while grounded, and ends Perched on the top after Climbing
  • A walk along the Dock's top meets no wall
  • A sprite dropped behind the Dock climbs out onto it, from further in than half a sprite
  • A sprite dropped nearer the Dock's right end climbs out that side
  • A Dock that unhides around a sleeping sprite wakes it onto the top
  • A sprite on a display below the Dock's is not behind the Dock: it neither climbs nor moves. Without the display bound this test loops the sprite for ever — climb, top out, fall, climb

cargo test --all-targets (457 tests), node --test tests/*.test.js (23), cargo fmt --check and cargo clippy --all-targets -- -D warnings all pass.

Notes

DOCK_PERCH_ID moved from snapshot.rs to window_source.rs, beside the WindowId it is one of. snapshot.rs already imports the Engine's types, so reading the const from there made the Engine depend back on the snapshot assembler; both now read it from the layer below them.

The Engine does not clamp dt, so a step longer than the Dock is wide would cross it unseen. The snapshot assembler caps elapsed_ms at one poll interval, which is what keeps a step small. That is pre-existing, and noted at the seam.

Closes #176

@cursor
cursor Bot force-pushed the fix/dock-side-is-a-wall branch from e977857 to ca6b1f0 Compare September 2, 2026 04:47
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The sprite walks behind the Dock, where it cannot be seen or grabbed

1 participant