Log inGet started
World

Ganesha: Guardian of the Portal

Branchmain
Branchesmain
Commit1ae1a54e78

README.md

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 in G.SLICES, subscribes to the bus, and parks the run on G.ACT.TITLE.
  • update(dt) — counts down the banner, toast and shake timers in real time (dividing out engine.timeScale), and drives hit-stop by holding engine.timeScale low for the freeze's duration.
  • onDestroy() — drops every bus subscription and restores engine.timeScale.

Notes

  • A slice that is not written yet is skipped, not an error. Each entry in G.SLICES is checked with asset.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.MOUNTS names the five entities the scene lays out; a slice reaches its mount with entity.find(G.MOUNTS.Hero) rather than guessing a path.
  • Acts advance from events, never from polling. The Director reacts to FOE_DIED and PLAYER_DIED; the world slice reports a portal reached by emitting its own event and letting this decide.