Log inGet started
World

Hullbreaker

Branchmain
Branchesmain
Commitcdbe4bf730

README.md

game.wiring.hazard

The hazard slice's door into the scene. Owned by the hazard slice; no other agent edits this file.

What it wires

  • attach.director → HazardDirector, so the wreck's temper is baked onto the scene's RunDirector the next time build.luau runs. It is also ensured in onSceneReady, because attach only takes effect on a scene rebuild and this slice does not own that file — so the slice works either way, and adding it twice is guarded.
  • onSceneReady → game.hazards.buildRig(), which spawns everything else at runtime under one HazardRig root: seven PressureVents down the shaft, six Debris cross-braces that are structure until they are not, and fourteen Debris chunks adrift. It runs in both edit and play, so a vent can be looked at and tuned while authoring instead of only existing once someone presses play.

The slice, in one line each

  • game/hazards.module — the numbers, the manifests, the arming gates, and the two calls a hazard is not allowed to make for itself (playerBody, impulse).
  • game/PressureVent.component — the jets. Rest, glow, blow.
  • game/Debris.component — braces that let go, and junk that drifts.
  • game/HazardDirector.component — when a member lets go, how much junk is awake, and every counter a run can be read by.

What it takes from other slices

  • state.instability (written by shell) is the only input. 0 is quiet; vents arm at 1, collapse at 2, debris at 3.
  • state.phase — hazards stop entirely once the run is won or lost.
  • flight's Scrapper:applyImpulse(x, y, z) is the only way this slice moves the player, resolved off the component's declared surface at runtime.

What it gives back

RULES.emit("impact", amount, source) with source in "vent" / "collapse" / "debris". Nothing else crosses the boundary.