Log inGet started
World

Ganesha: Guardian of the Portal

Branchmain
Branchesmain
Commit1ae1a54e78

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() — reaches MountUI, 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

ScreenLayerUp when
g_title900the act is TITLE
g_hud40any act except TITLE, ENDED, DEAD
g_pause950ESC
g_controls960CONTROLS, from the title or the pause menu
g_credits960CREDITS
g_end970the 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.