BLOBBO/src/machine/index.ts
type-two 8aaa11cdc1 Lane C: Rube-Goldberg machine toolkit — telegraphs, parts, surfaces, chain demo
Player-triggered contraptions that chain purely via world.events
('machine:signal') with a mandatory ~0.5s telegraph before any force or
paint dump (GDD readable-chaos pillar).

src/machine/:
- telegraph.ts: unmissable windup (accelerating flash + shake + scale pulse)
  ticked once per world; parts await it and only then fire.
- parts.ts: PressurePlate (real body.mass() threshold), SpringBoot
  (telegraph -> impulse on strike volume), SeeSaw (Rapier revolute joint
  with limits + optional rest tilt), BucketDump (telegraph teeter ->
  paint:request-splat + slosh), ConveyorBelt, BubbleArch (rising-edge
  paint:request-cleanse + bubbles), Fan (per-step impulse so mass does the
  work). Config-driven; no cross-instance references.
- surfaces.ts: normal/ice/oil/honey/mud/water registry with applySurface +
  surfaceAt (downward ray) query.

demos/lane-c.html + src/demo/lane-c.ts: heavy ball runs
PressurePlate -> SpringBoot -> SeeSaw -> ice runway -> BucketDump, plus
conveyor/arch/fan and ice/honey probe lanes. Debug keys T/L/S/F/P and
per-second STATE console lines. Layout constants tuned via a headless
physics sweep so the chain completes deterministically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 20:26:52 +10:00

36 lines
799 B
TypeScript

/**
* Lane C — Machine toolkit public surface.
* Contraptions chain via `world.events` ('machine:signal') and talk to the paint
* lane via 'paint:request-splat' / 'paint:request-cleanse' only.
*/
export { telegraph, isTelegraphing } from './telegraph'
export type { TelegraphOptions } from './telegraph'
export {
SURFACES,
SurfaceRegistry,
applySurface,
} from './surfaces'
export type { SurfaceName, SurfaceMaterial } from './surfaces'
export {
createPressurePlate,
createSpringBoot,
createSeeSaw,
createBucketDump,
createConveyorBelt,
createBubbleArch,
createFan,
} from './parts'
export type {
Vec3,
MachinePart,
PressurePlateConfig,
SpringBootConfig,
SeeSawConfig,
BucketDumpConfig,
ConveyorBeltConfig,
BubbleArchConfig,
FanConfig,
} from './parts'