Log inGet started
Package

sunfall.package

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

SunfallUi

Every on-screen interface of Sunfall Ridge, in one component. Put it on one entity of a scene that runs the game (it needs no sibling components and no mesh); it reads the shared run state in sunfall.game and shows the screen for the current Game.state.phase:

  • title: SUNFALL RIDGE over the ridge beauty shot with only a soft gradient scrim, the tagline, a FLY button (Game.request("fly"), also Enter / pad A), the player's best score, best flight and feather total, and glider and trail pickers from sunfall.progress showing each option's lock state and feathers needed (a click selects through Progress.select; a locked card shakes).
  • cinematic: letterbox bars easing in and out, the title card fading in and out a few seconds in, and a skip hint; any key, click, tap or pad button calls Game.request("skip").
  • flight: a minimal HUD at the screen edges: the sun dial (the sun sinking to the horizon as light falls) with time left as m:ss turning ember and pulsing in the last 30 s; height above the meadow, a climb/sink vario bar and number, airspeed (km/h); the meadow compass with distance and a "behind, turn left/right" cue; the course line with the thermal count; a soft THERMAL cue when inThermal turns true; first-flight hints worded for keyboard, pad or touch.
  • result: a card reading Game.state.result: headline and detail, three feathers landing one by one, the score counting up with its breakdown rows, New best and every unlocked label, and FLY AGAIN ("retry") / TITLE ("title"). Success is gold and warm; outlanding, crash and nightfall are ember and cooler, nightfall under a darker scrim.

Beside them it always draws Game.state.fade as a full-screen fadeColor overlay below its own screens, and Game.state.message as a centre-top caption that fades in and out.

Screens fade and slide between phases, honour reduced motion, lay out for a phone (a compact layout below 560 points tall or 900 wide) as well as 1920x1080, and only the title and result hold the pointer, so the flight keeps its mouse and the HUD takes no clicks.

Placing it

local ui = entity.spawn("SunfallUi")
ui.component.add("sunfall.SunfallUi", {})

Fields: layer (UI layer of the phase screens, default 40; the fade draws 20 below, the caption 2 above), hints (first-flight hints, default on), hudRate (most HUD rebuilds per second, default 24; it only rebuilds when a reading changed).

It runs while the gameplay clock runs (play). The look lives in sunfall.ui.style.