BLOBBO/lanes/LANE-A-engine-feel.md
type-two 969f602dd4 Foundation: vite+ts+three+rapier scaffold, frozen contracts, lane docs A-E
Fixed-step world runtime, event bus wire protocol between lanes, integration
seam (game.ts) with placeholder ball. Lanes A/B/C own disjoint dirs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 19:55:43 +10:00

2.3 KiB

Lane A — Engine / Feel

Owns: src/blob/, src/course/, demos/lane-a.html, src/demo/lane-a.ts. Never touches: src/contracts.ts, src/world.ts, src/game.ts, src/main.ts, package.json, other lanes' dirs. New deps are not allowed — three + rapier only.

Mission

Make moving a blob around feel funny and good. Build the blob controller, the follow camera, the squash/jiggle, and a greybox course chunk to play in.

Deliverables

  1. src/blob/createBlob.ts — implements Blob from src/contracts.ts:
    • Rapier dynamic ball collider (radius ~0.5) + THREE group with a soft white blob mesh (UV sphere is fine — clean UVs matter, Lane B paints them).
    • Movement: WASD/arrows accelerate via impulses/torque, camera-relative; Space = jump (grounded check via ray or contact); small air control.
    • Reads blob.modifiers EVERY frame and respects: speedMul, jumpMul, massMul (scale collider mass), grip (0..1, boosts effective friction / kill slide), size (uniform visual+collider scale).
  2. Feel layer: squash on landing, stretch on jump, idle wobble — cheap sine/spring on mesh scale or vertex shader. It should read as soft-body even though physics is a rigid ball. This is the game's comedy engine: overshoot it.
  3. src/blob/camera.ts — third-person soft-follow camera with lag + slight FOV kick at speed.
  4. src/course/greybox.ts — export buildGreybox(world): a Breakfast Rush test chunk from primitives: start plateau, two ramps, a gap jump, a slope, a flat "milk river" plane (tagged surface:water via userData), open flat area (machines land here in integration), finish pad. Big, readable, absurd proportions.
  5. Demo page demos/lane-a.html + src/demo/lane-a.ts: boots world, builds greybox, spawns blob, plays. Add 3 debug keys: 1/2/3 set modifiers.speedMul=1.6 / jumpMul=1.5 / size=1.5 to prove modifier plumbing.

Acceptance

  • npm run build passes. Demo runs at 60fps.
  • Blob accelerates, jumps, lands with visible squash; wobble reads as soft.
  • Debug modifier keys visibly change behavior.
  • No edits outside owned paths.

Contracts (frozen — read src/contracts.ts first)

Events you may emit: blob:landed {impact:number}, blob:jumped. The world fixed-steps physics at 60Hz; register via world.addSystem.