Edge sensors: slide over the edges of floors, walls and ceilings #3

Merged
SnekInAScarf merged 2 commits from floor-edge-drop into main 2026-10-31 20:47:28 -05:00

2 commits

Author SHA1 Message Date
01eb5adbd1 Rotate edge sensors with the surface so edges work on walls and ceilings
The edge sensors now live under an EdgeSensors pivot that's rotated to
point into whatever surface the slime is on. Pressing into the surface
(down on floors, up on ceilings, towards the wall on walls) near an edge
slides over it onto the side of the platform. The other axis picks the
side; otherwise facing decides (last direction moved along a wall).

- Ceiling edge -> wall above, wall top -> floor, wall bottom -> ceiling
  underneath, floor edge -> wall below, all through one code path.
- Skip sensors that start inside something (inside corners).
- _begin_wrap takes the normal of the surface to end up on and works
  out the sprite rotation from it; wraps can now end on a ceiling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 13:11:14 -07:00
815444f3af Slide over floor edges onto the wall below when pressing down
Two RayCast2D edge sensors point down into the floor edgeSensorRange to
each side of the slime. When one stops touching floor there's an edge in
range on that side, and pressing down slides to it, swings over the
corner and carries on down the wall so the slime ends flat against it.

- Down + a direction picks that side; down alone goes the way the slime
  is facing, or the other way if only that side has an edge in range.
- Down in the middle of a platform does nothing.
- edgeSensorRange is exported (default 24, tuned with a headless sweep).
- Wraps can now start with a straight move to the arc, and end with a
  move_and_slide so is_on_floor()/is_on_wall() aren't stale afterwards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 13:02:05 -07:00