Ganesha: Guardian of the Portal
README.md
Screens — everything the game puts on the glass
One instance, on the scene's MountUI. Owns the title card, the HUD, the quest
line, the cinematic boss bar, the banners, the pause menu, the controls card and
the ending cards.
Public fields
None. It reads game.Game.state and never writes it.
Methods
:screens()— the names of the screens it registers.
Lifecycle
start()— reachesMountUI, builds all six screens, and shows the one the current act calls for.update(dt)— rewrites the HUD every 0.12 s, re-applies the act, and reads ESC (pause) and R (retry after a loss).onDestroy()— unsubscribes and hides every screen it registered.
Screens
| Screen | Layer | Up when |
|---|---|---|
g_title | 900 | the act is TITLE |
g_hud | 40 | any act except TITLE, ENDED, DEAD |
g_pause | 950 | ESC |
g_controls | 960 | CONTROLS, from the title or the pause menu |
g_credits | 960 | CREDITS |
g_end | 970 | the act is ENDED |
Notes
- Every colour comes out of
G.PALETTE, so the interface and the world cannot drift apart: gold is divine power, marigold is the festival, the rift colours are the portal, stone and bone are stone and bone. - The HUD is one screen. Its text-bearing widgets carry ids and are
rewritten in place by
gui.update; the boss bar and the player bars are drawn as block glyphs at a fixed width, so a value change never re-lays out the frame. - The screens do not own the game. A press is answered by calling the
Director's public verbs —
beginRun,retryArena,toTitle— so the rules stay in one place.