PYRAMID — Tower Defense
README.md
EnemyDirector
The night. One instance lives on the scene's GameDirector entity, attached by
scenes/main.scene/entrypoint.luau at play start.
- Registers itself as
pyramid.state.director, which is what makesState.requestWave()(the HUD's SEND WAVE) reach:sendWave(). - Reads
rules.WAVES: every group'sdelay,countandgapbecome a sorted schedule of bodies, each spawned as a temporary entity carrying theEnemycomponent, spread across three lanes on the 3 m road. - Advances
State.time(the clock the slows are measured against) every frame, and drives the phase:build→wave, then+4stone and back tobuildwhen the wave is cleared, orwonafter wave 8.lostis reached throughState.shatterandState.spendinpyramid/state, not from here. - Owns the transient dust: a
killevent puffs ochre sand at the body, aleakthrows limestone and turquoise faience off the seal. Motes are spawnedtemporaryand pooled, so a running night never writes them into the scene. - Clears the road if the run is reset (
State.wavefalls back to 0).
Emits wave and wave_cleared with { wave = n } alongside the state module's
own stone / phase / shatter events, for the HUD and the sound pass.
Needs pyramid.rules and pyramid.state, and the Enemy component (the bodies
it spawns). Nothing else in the slice depends on its internals: the shared
surface is State.