Commit graph

54 commits

Author SHA1 Message Date
beeebbf47e Rework manual tubes: steerable goo with a leader indicator
Manual tubes (TubeSteer):
- The slime is pulled fully into the tube on entry; tubes too short for it
  squash it to fit, with a few pixels poking out of each mouth.
- A leader slides quickly through the goo without moving it, and drags the
  goo at normal speed once past an end. At covered junctions it can turn into
  another arm, or pull into an empty branch, draining the goo from all sides.
- Only coloured pixels go in; a black outline is drawn around the goo, with
  rounded ends in the tube.
- The leader is a pulsing circle; colour, border colour and radius are set
  under "Tube Indicator" on the Player.

Tiles and level:
- Plain tube tiles are now manual, green ones automatic. Test level tubes
  repainted plain so they stay manual.

Also included (earlier work): goo tube prototype (TubeGoo, purple tiles) and a
max length for the automatic pixel stream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 12:03:12 -08:00
32d82b4bd1 Rework manual tubes: steerable goo with a leader indicator
Manual tubes (TubeSteer):
- The slime is pulled fully into the tube on entry; tubes too short for it
  squash it to fit, with a few pixels poking out of each mouth.
- A leader slides quickly through the goo without moving it, and drags the
  goo at normal speed once past an end. At covered junctions it can turn into
  another arm, or pull into an empty branch, draining the goo from all sides.
- Only coloured pixels go in; a black outline is drawn around the goo, with
  rounded ends in the tube.
- The leader is a pulsing circle; colour, border colour and radius are set
  under "Tube Indicator" on the Player.

Tiles and level:
- Plain tube tiles are now manual, green ones automatic. Test level tubes
  repainted plain so they stay manual.

Also included (earlier work): goo tube prototype (TubeGoo, purple tiles) and a
max length for the automatic pixel stream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 13:36:36 -08:00
d9c86a181d Prototype code for two pipes: one that requires manual movement, and one that automatically moves the player along the path. 2026-11-09 14:52:32 -08:00
f13ca3f44f Add pipe travel 2026-11-08 19:39:40 -08:00
90bd03d194 Added main menu and also dissolve screen transition 2026-11-08 18:54:04 -08:00
ca6cc3a370 Undid some prototype stuff and updated player sprite and animation 2026-11-08 18:42:23 -08:00
98187b6742 Shatter into chunky physics pixels that stack
Each 2x2 block of the slime's frame (black pixels left out) is now a
rotation-locked RigidBody2D on its own layer, so the pieces bounce off the
level, get pushed by the piston and pile up on each other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:09:00 -08:00
38d7e6d761 Prototype: timed piston hazard that shatters the slime into pixels
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>
2026-11-08 11:41:01 -08:00
f1fc198a5b Add custom level tiles and update inAir sprite for slime. 2026-11-04 14:41:43 -08:00
acd25f9909 Stop at ledges with the leading edge sensor at the edge
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>
2026-11-03 14:10:26 -08:00
e6aaf57ec6 Added new animations for slime. 2026-11-01 16:23:36 -08:00
346f87831b Merge branch 'main' of https://forgejo.smhub.duckdns.org/SnekInAScarf/SlimePlatformer.git into main 2026-11-01 11:15:37 -08:00
db04dfc045 Testing out slight name change. 2026-11-01 11:14:51 -08:00
762b25c70b Testing out slight name change. 2026-11-01 10:25:40 -08:00
571196f292 Merge pull request 'Simplify the edge wrap: 8 state variables instead of 15' (#9) from simpler-wrap into main 2026-11-01 02:19:40 -06:00
06789e2f36 Simplify the edge wrap: 8 state variables instead of 15
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>
2026-11-01 01:13:01 -07:00
cfea34861f Some adjustments to naming and comments to player.gd 2026-11-01 01:05:32 -07:00
8fe449099b - Added animated sprite for slime player.
- Made slime face proper direction on walls.
2026-10-31 22:53:42 -07:00
bec85cefe3 Merge pull request 'Make player.gd easier to read for newer programmers' (#8) from beginner-readability into main 2026-10-31 20:47:57 -05:00
e5bdc85293 Merge pull request 'Remove the lip hang, which the edge hold has made unreachable' (#7) from remove-lip into main 2026-10-31 20:47:51 -05:00
90186a6c2e Merge pull request 'Clean up player.gd: names, comments, grouping, smaller _physics_process' (#6) from player-cleanup into main 2026-10-31 20:47:45 -05:00
4eb50988ea Merge pull request 'Hop across to a surface within a tile (floor, walls and ceilings)' (#5) from floor-hop into main 2026-10-31 20:47:40 -05:00
809c308a09 Merge pull request 'Smoother movement feel, plus landing/wrap sounds and splat particles' (#4) from movement-feel into main 2026-10-31 20:47:34 -05:00
f9c20f4de9 Merge pull request 'Edge sensors: slide over the edges of floors, walls and ceilings' (#3) from floor-edge-drop into main 2026-10-31 20:47:28 -05:00
0f24145f49 Merge pull request 'Smoothly wrap around ceiling lips and wall tops' (#2) from smooth-edge-wrap into main 2026-10-31 20:47:22 -05:00
cb0ce427aa Trim player.gd comments: shorter, and none that restate the code
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>
2026-10-31 18:32:13 -07:00
804a7a76c9 Make player.gd easier to read for newer programmers
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>
2026-10-31 18:09:43 -07:00
6622544acb Remove the lip hang, which the edge hold has made unreachable
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>
2026-10-31 17:44:49 -07:00
693df2f2cf Clean up player.gd: names, comments, grouping, smaller _physics_process
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>
2026-10-31 17:43:17 -07:00
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
31f1de7d68 Halve edgeSensorRange to 12 so edge wraps need the slime at the edge
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>
2026-10-31 15:54:34 -07:00
ad9e8d62fa Stop the edge sensors from hitting the player's own collider
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>
2026-10-31 15:54:15 -07:00
c212748b8d Don't treat tile seams or the foot of a wall as an edge
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>
2026-10-31 15:14:07 -07:00
e5c176f1f6 Hold at the edge of any surface before letting go
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>
2026-10-31 15:02:33 -07:00
20f4785d56 Smoother movement feel, plus landing/wrap sounds and splat particles
- 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>
2026-10-31 13:37:54 -07:00
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
b098b78934 Stay on the wall after wrapping around a lip
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>
2026-10-31 12:46:08 -07:00
43380dd72c Smoothly wrap around ceiling lips and wall tops
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>
2026-10-31 12:41:11 -07:00
c72708e63e Merge pull request 'Fix climbing from a ceiling lip onto the wall above' (#1) from fix-lip-wall-climb into main
Reviewed-on: #1
2026-10-31 14:38:25 -05:00
485553df3e Fix climbing from a ceiling lip onto the wall above
- 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>
2026-10-31 12:30:08 -07:00
0db36e2526 Added lip climbing 2026-10-30 23:59:38 -07:00
64188a72d3 Revert "blah"
This reverts commit 454624856d1f686e4ce5e3df4e6a5e2b47cfc83d.
2026-10-30 23:16:23 -07:00
f70cc0b97a Added extra code for sticking to the wall or ceiling.
- Slight delay before unsticking from a wall/ceiling.
2026-10-29 14:25:36 -07:00
4df996690e - Removed jumping code
- Add clinging to ceiling upon touch
2026-10-29 01:28:37 -07:00
ca14c26a2d - New placeholder slime sprite
- testing removing jump from player
2026-10-26 23:28:46 -07:00