The piston winds up, slams down, holds and retracts on a timer. Catching the
slime under the head breaks its current frame into one particle per non-black
pixel, which bounce off and settle on the level. The level reloads afterwards.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The slime used to stop with its center on the corner, leaving the flat
side of the sprite floating past the edge. It now stops with the leading
sensor just past the edge, so the sprite's side lines up with it. Holding
on then detaches, and pressing into the surface wraps from there.
Wall tops now stop the same way, instead of carrying straight on into the
wrap, and walls show the ReachX animation while held at an edge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Store only what can't be worked out: the corner, the surface normals we
leave and land on, where we started, where the arc begins, and the speed
and distance travelled. Arc radius and length, entry length, the exit
move and the sprite rotations are now small _wrap_... helpers.
_begin_wrap takes (corner, fromNormal, ontoNormal[, arcStartAngle])
instead of five loosely related values.
Same behaviour, except the wall-top wrap now always uses the arc's radius
(a straight sub-pixel entry instead of easing it during the arc) and turns
the sprite from the wall's rotation rather than wherever it was: at most
~0.5px and ~4 degrees different mid-wrap, ending in the same place.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only comments and blank lines changed (the code with comments stripped
is identical). Shortened the overview, section headers and longer
explanations, and removed comments that just describe the next line.
Kept the ones explaining why or non-obvious maths.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No behaviour change (the 1180-frame scripted trace is identical before
and after, and all headless tests pass).
- Overview at the top: what the slime can do, how a frame runs, and a
glossary (y points down, delta, normal, tangent, dot product, raycast).
- Big section headers; every setting has a plain-English comment.
- No backslash line continuations or dense one-line if/elses: long
conditions are split into named bools (climbedPastWallTop, holdingDown,
standingStill, hitHeadOn, ...), one-line ifs are full blocks.
- Explicit checks instead of truthiness (== 0.0, .is_empty(), == null).
- The maths is explained: the hop speed formula (now _get_hop_speed),
exponential smoothing, arc length, the wall-hop arc.
- Clearer names: pos -> currentPosition, line -> justInsideSurface,
step -> distanceThisFrame, along -> inputAlongSurface, offset ->
fromCorner, wrapTravelled -> wrapDistanceTravelled, and the wrap angle
parameters -> arcStartAngle/arcEndAngle.
- Letting go of walls and ceilings split out of the movement steps into
_update_wall_letting_go and _update_ceiling_letting_go.
- Keeps the "FX resources" grouping of the sound/particle nodes and
landSounds from the working copy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The edge hold stops the slime before it leaves a ceiling, so the lip
(hanging just past a ceiling edge after leaving it) never started any
more: 0 times in 116 ceiling-edge crawls covering both directions, many
starting points and thin/thick platforms. Removes its state,
_start_lip_wrap, CLIMB_INPUT_BUFFER and timeSinceUpPressed.
_start_wall_top_wrap keeps its own raycasts: it runs after we've passed
the corner, where _find_edge_corner can't see it. Comment added.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No behaviour change (a 1180-frame scripted trace is identical before and
after, and all headless tests pass).
- Renames: MAX_SECS_TO_UNSTICK -> HOLD_TIME (it times holds, hops and
lips too), HOP_MAX_HEIGHT -> HOP_REACH (also sideways/down),
ROTATE_TO_WALL_SPEED -> ROTATE_TO_SURFACE_SPEED, isClimbingLip ->
isHangingOnLip, timeSpentUnstickingLip -> timeSpentOnLip, plus
n/dir -> wallNormal/direction.
- CLIMB_SPEED and CEILING_STICK_SPEED are positive like the other speeds,
with the direction applied where they're used.
- Missing type annotations added (including sprite: Sprite2D).
- Constants and state grouped by feature; magic numbers for sensor depth
and landing pitch named.
- _physics_process split into _update_facing, _update_vertical_movement,
_update_floor_hop, _update_horizontal_movement, _update_wall_sticking
and _update_ceiling_sticking; _finish_wrap split out of _update_wrap.
- _accelerate/_air_steer take delta like the other helpers.
- Stale and vague comments fixed (lip push marked as a fallback, the
resolved note at the top removed, typos).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
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>
- 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>
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>
Pressing into a surface now only wraps around its edge when the slime's
center is within 12px of it, i.e. the slime is touching the edge (about
1px gap), instead of up to 13px away with the old 24. Walking up to an
edge still always works, since the edge hold stops the slime there.
Measured with a headless sweep of 24/16/14/12/10/8/6/4 on floors,
ceilings and wall bottoms.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since the sensors moved under the EdgeSensors pivot, exclude_parent
excludes the pivot rather than the player. With edgeSensorRange equal to
the slime's radius the rays start on the edge of its circle and hit it,
so edge wraps never triggered. Add the player as an exception.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The level's TileMapLayer is made of separate collision shapes, and the
ray that looks for the side of a platform could hit the inside face of
a neighbouring tile. That made walking along the floor stop and "hold"
at tile seams and next to walls. A corner now only counts as an edge if
there's empty space just past it, behind the surface.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moving along a floor, ceiling or down a wall towards its edge now stops
at the edge, and only carries on over it after holding towards it for
MAX_SECS_TO_UNSTICK. Before, only ceilings had this (the lip, which
started after leaving), so walking off a floor sideways or crawling off
the bottom of a wall dropped instantly. Climbing up past a wall top
still swings over onto it straight away.
- While holding at an edge, pressing into the surface still wraps
around it.
- After wrapping onto a ceiling, a held down doesn't count towards
letting go until it's released (like walls already did).
- Pull the corner finding out of _try_edge_wrap into _find_edge_corner.
- project.godot: settings re-sorted by the editor, no change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Accelerate to full speed in 4 frames and stop in 6, on floors, walls
and ceilings, instead of snapping.
- Keep momentum when leaving a surface; air steering is gentler and
extra speed fades slowly. Fall speed capped at 400.
- Edge wraps ease in from a standstill and carry their speed out onto the
new surface.
- Pull back onto a wall/ceiling that's drifted up to 4px away instead of
falling off (floor_snap_length matches).
- Physics interpolation and pixel-snapped 2D transforms. Sprite rotation
moved into _physics_process and made frame-rate independent.
- Squish sound + slime particles on landing, bubble sound on wraps.
Placeholder CC0 sounds by rubberduck from OpenGameArt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
The wrap ended with the slime level with the corner and WRAP_MARGIN away
from the wall. The wall stick push only covers ~0.33px a frame, so it
often didn't touch the wall on the next move_and_slide, stopped sticking
and fell.
- After the arc, carry on straight up the wall by the radius (or onto the
platform for wall tops) so the slime ends flat against the surface.
- Close the remaining gap with move_and_collide when the wrap finishes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Instead of relying on physics to slide the round collider around a
corner, find the corner with raycasts and swing the slime around it on
a quarter circle at crawling speed, rotating the sprite along with it.
- Hanging on a ceiling lip + up: swing onto the wall above.
- Climbing up past the top of a wall: swing over onto the floor on top.
- Tapping up up to 0.15s before reaching a lip still counts.
- Falls back to the old behaviour if the corner can't be found or there
is no room at the end of the swing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Pressing up while hanging on a lip now moves the slime up and back
towards the platform so it wraps onto the wall instead of staying frozen.
- Only walking off a ceiling edge starts a lip hang (not landing on a
ceiling or dropping off it with down).
- Don't count the held direction towards unsticking from the wall right
after climbing on from a lip, until it's released.
- Remove leftover debug print.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>