Make player.gd easier to read for newer programmers #8

Merged
SnekInAScarf merged 2 commits from beginner-readability into main 2026-10-31 20:47:57 -05:00

2 commits

Author SHA1 Message Date
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