HardYards/web/world/js
m3ultra 7cd25a5d2a Give the gum trees a canopy sway handle
world.js sways a tree by rotating a `canopy` group whose origin sits at the
trunk top, so the blobs swing about the trunk. The trees shipped canopy_01..03
as siblings of `trunk` with each origin at its own blob centre — rotating one
spins a sphere in place, which is visually nothing. Lane A could not have swayed
these trees, and the canopy lean is the gust telegraph the player reads a beat
before it hits the sail, so the tell would have gone missing rather than looked
wrong.

Adds the `canopy` empty at the trunk top with the blobs parented under it, so
A's existing code works unchanged, plus sway_amp / sway_phase / sway_pivot_y
for the per-tree tuning SPRINT2 §Lane E asks for (gum_01 is big and leans less
at 0.85; gum_02 is whippy at 1.20 and shows a gust first).

sway_phase draws from its own RNG stream: taking it from the shared one would
consume a value and shift every blob draw after it, resilhouetting a tree the
other lanes have already tuned against. Exported dims are identical to Sprint 1.

e.test.js asserts the pivot by rotating the handle and measuring that a blob
actually travels — red before this change, green after.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 00:42:30 +10:00
..
tests Give the gum trees a canopy sway handle 2026-07-17 00:42:30 +10:00
camera.js Add graybox yard, third-person camera and game shell 2026-07-16 21:33:42 +10:00
contracts.js Align sail lane to contracts.js; free blown corners so they flog 2026-07-16 21:55:37 +10:00
debris.js Fix debris ground friction, cloud seam and yard coords 2026-07-16 21:50:41 +10:00
interact.js Lane D: the small person — player, interactions, selftests 2026-07-16 21:55:16 +10:00
main.js Assemble the game: real wind, player, sail, sky and debris (gate 1) 2026-07-16 23:38:03 +10:00
player.js Merge all lanes; add importmap; fix /world/ absolute paths 2026-07-16 22:23:20 +10:00
player.sim.js Lane D: the small person — player, interactions, selftests 2026-07-16 21:55:16 +10:00
rigging.js Align sail lane to contracts.js; free blown corners so they flog 2026-07-16 21:55:37 +10:00
rigging.selftest.js Align sail lane to contracts.js; free blown corners so they flog 2026-07-16 21:55:37 +10:00
sail.js Align sail lane to contracts.js; free blown corners so they flog 2026-07-16 21:55:37 +10:00
sail.selftest.js Align sail lane to contracts.js; free blown corners so they flog 2026-07-16 21:55:37 +10:00
skyfx.js Expose audio state and levels 2026-07-16 21:56:22 +10:00
testkit.js Add selftest harness with one suite per lane 2026-07-16 21:33:42 +10:00
weather.core.js Fix debris ground friction, cloud seam and yard coords 2026-07-16 21:50:41 +10:00
weather.js Add debris, skyfx and the Lane C bench; align to landed contracts 2026-07-16 21:38:21 +10:00
world.js Expose the yard's hemisphere light for skyfx 2026-07-16 23:38:03 +10:00