Director
The referee of **GANESHA: GUARDIAN OF THE PORTAL**. One instance, on the scene's `Director` entity. It boots every slice onto its mount, owns the story machine's act transitions, keeps the shared timers (banner, toast, camera shake, hit-stop) and hands the interface slice the ver…
Director
The referee of GANESHA: GUARDIAN OF THE PORTAL. One instance, on the scene's
Director entity. It boots every slice onto its mount, owns the story machine's
act transitions, keeps the shared timers (banner, toast, camera shake, hit-stop)
and hands the interface slice the verbs it needs. It draws nothing, moves
nothing and sounds nothing — the slices do all of that, and this decides when.
Public fields
None. The Director's state is the run state itself, held in game.Game.state.
Methods
:beginRun()— leave the title screen, open at the festival (quest 1, arena 1).:retryArena()— restore the guardian and re-enter the arena they fell in.:startFight()— begin the current arena's fight with no intro beat.:toTitle()— return to the title screen.:liveSlices()— the slice ids whose component type is registered and running.
Lifecycle
start()— boots the slices named inG.SLICES, subscribes to the bus, and parks the run onG.ACT.TITLE.update(dt)— counts down the banner, toast and shake timers in real time (dividing outengine.timeScale), and drives hit-stop by holdingengine.timeScalelow for the freeze's duration.onDestroy()— drops every bus subscription and restoresengine.timeScale.
Notes
- A slice that is not written yet is skipped, not an error. Each entry in
G.SLICESis checked withasset.exists(name, "component"); an unregistered one is passed over and lands the moment its component file exists. That is what lets the slices be built one at a time against a scene none of them writes. - The mount names are the interface.
G.MOUNTSnames the five entities the scene lays out; a slice reaches its mount withentity.find(G.MOUNTS.Hero)rather than guessing a path. - Acts advance from events, never from polling. The Director reacts to
FOE_DIEDandPLAYER_DIED; the world slice reports a portal reached by emitting its own event and letting this decide.
Scoped to this part · feeds back into the world's score.