First Light: Lavic Odyssey
README.md
Screens
The presentation slice of First Light: Lavic Odyssey. It owns four screens and nothing else in the world.
| Screen | Layer | What it is |
|---|---|---|
fl_visor | 30 | the inside of the great helm, and the heat coming for a bare head |
fl_hud | 40 | the heat column, the freed knights, the dawn ladder, the clock |
fl_toast | 60 | a canto announcing itself at the top of the frame |
fl_card | 800 | title, how-to-play, pause, and the two end cards |
Mounted by the scene entrypoint onto mount_screens as
game.screens.Screens. It spawns nothing, moves nothing, and takes every
screen down again in onDestroy.
Three ways into every control
Every control on every card is reachable three ways, and the three never disagree about where the player is:
- A pointer clicks the control; the widget's own
onClickdelivers it. - A finger taps it. Each control is at least
L.layout().touchTargeton its shortest side, and the menu map binds no on-screen pad over the top of a card. - A pad walks a gold focus ring with
navigate/navigateDpadand pressesconfirm. The focus order IS the ordered list of ids each card returns beside its tree, so a control cannot be drawn and left unreachable — and reaching one by pointer or finger moves the ring there too.
game.input.menu is live only while a card is on the glass. It declares
group ui and suppresses climb and player, so Escape closes the card
instead of pausing again and the pilgrim does not walk behind a menu.
Every shape
Nothing here holds a pixel position. Every measure comes from
L.layout(), which reads ui.screenSize() on each build, so a phone held
either way, a laptop and a television all get the same composition at
their own scale. A tall frame stacks; a wide one puts the how-to card's
prose and controls side by side and drops the title couplet, because a
wide frame has far less vertical room than a tall one.
The two HUD columns live in the upper half of the frame and never span the width: the rules slice's on-screen touch controls take the lower zones and the staging slice's captions take the bottom band.
What it reads and what it asks for
Reads L.state (phase, helmOn, heat, height, canto, freed,
elapsed, cause) and listens on L.bus for canto, cutscene and
phase. Emits requestStart, requestResume, requestRestart and
requestTitle — the rules slice owns the phase machine and answers them.
UI sounds go through require("game.sound.sfx") when that module exists —
ui_move on a focus step, ui_confirm on an activation, ui_back on a
retreat — and the slice works unchanged when it does not.
The how-to card's control table is read live off game.input.lavic and
game.input.menu, so it can never claim a control the maps do not carry.