Hop across to a surface within a tile (floor, walls and ceilings) #5

Merged
SnekInAScarf merged 5 commits from floor-hop into main 2026-10-31 20:47:40 -05:00

5 commits

Author SHA1 Message Date
f167c74204 Only let go of walls and ceilings when not moving along them
Holding away from a wall while climbing, or down on a ceiling while
moving left/right, no longer counts towards MAX_SECS_TO_UNSTICK; the
timer starts over once you stop. Same rule as the floor hop, and it
covers both letting go and hopping across.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 17:31:14 -07:00
f9f196d8c6 Fix falling off the wall right after a floor-edge wrap on right ledges
When a wrap finishes, Godot still thinks we're on the floor we started
from. On the finishing move_and_slide it then snapped us down onto it
(floor_snap_length) and counted the wall we were pushed into as floor
(floor_block_on_wall), so we landed as "on floor", stuck to nothing,
and fell the next frame. It only happened on right-hand ledges because
of how the contact lined up. Turn both off for the finishing move unless
the wrap ends on a floor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 17:24:11 -07:00
e8cf70e6e5 Hop across from walls and ceilings too
Holding away from a wall or ceiling for MAX_SECS_TO_UNSTICK, while not
moving along it, now hops straight across to a surface within
HOP_MAX_HEIGHT on that side and sticks to it. With nothing in reach (or
while moving along the surface) it lets go as before.

- Wall hops go at crawling speed on an arc that lands at the same height,
  with no air steering until they land.
- Ceiling hops push down onto the floor below.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 17:16:48 -07:00
4b96d21add Only hop when not moving left/right; hop reach is one tile
- Holding left or right resets the hop timer, so the 0.5s hold only
  counts while standing still.
- HOP_MAX_HEIGHT is now 32 (one tile), as adjusted by hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 16:27:44 -07:00
935ee797dc Hop up to the ceiling after holding up on the floor
Holding up on the floor for MAX_SECS_TO_UNSTICK hops just high enough to
reach a ceiling up to HOP_MAX_HEIGHT (64px) above the slime's top, where
it then sticks. With no ceiling in reach it does a little 16px hop.
Against a wall, up still climbs it instead.

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