fl
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
fl
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
along(z: number) → number
How far along the lane a z is, 0 at the start and 1 at the roost.
| arg | type | description |
|---|---|---|
| z | number |
screen( ) → Screen
The live screen size and whether it is taller than it is wide.
unit(fraction: number) → number
A length that is `fraction` of the screen's SHORT side, in canvas units — the unit type sizes, paddings and gaps are stated in, so a card reads the same on a phone held either way and on a wide monitor.
| arg | type | description |
|---|---|---|
| fraction | number |
on(name: string, fn: Handler) → void
Subscribe to a named event. Returns a function that unsubscribes.
| arg | type | description |
|---|---|---|
| name | string | |
| fn | Handler |
emit(name: string, payload: any?) → void
Fire a named event. A handler that raises is logged and the others still run.
| arg | type | description |
|---|---|---|
| name | string | |
| payload | any? |
phase( ) → Phase
setPhase(next: Phase) → void
Move to a new phase and tell everyone. Entering "playing" from anywhere but "paused" resets the run clock.
| arg | type | description |
|---|---|---|
| next | Phase |
resume( ) → void
Resume from "paused" to whatever phase was interrupted.
tick(dt: number) → void
Advance the run clock. Only the rules slice calls this, once per frame, while the phase is "playing".
| arg | type | description |
|---|---|---|
| dt | number |
runTime( ) → number
Seconds since the run began.
progress( ) → number
0 at the start of the run, 1 when first light has filled the floor.
light( ) → number
The light on the floor, 0..1, eased so the dark holds and then goes fast.
provide(name: string, surface: any) → void
Publish a surface under a name. The shapes are documented in the spec.
| arg | type | description |
|---|---|---|
| name | string | |
| surface | any |
get(name: string) → any
Fetch a surface, or nil when its slice has not published yet.
| arg | type | description |
|---|---|---|
| name | string |
whenProvided(name: string, fn: (any) → void
Fetch a surface now if it exists, else the moment it is provided.
| arg | type | description |
|---|---|---|
| name | string | |
| fn | (any |
lerp(a: number, b: number, t: number) → number
Small maths every slice ends up rewriting.
| arg | type | description |
|---|---|---|
| a | number | |
| b | number | |
| t | number |
smooth(t: number) → number
| arg | type | description |
|---|---|---|
| t | number |
approach(current: number, target: number, rate: number, dt: number) → number
Exponential approach: moves `current` toward `target` at `rate` per second.
| arg | type | description |
|---|---|---|
| current | number | |
| target | number | |
| rate | number | |
| dt | number |
hash(a: number, b: number?) → number
A deterministic hash in [0, 1) for scattering props the same way on every peer.
| arg | type | description |
|---|---|---|
| a | number | |
| b | number? |
Screen = { w: number, h: number, tall: boolean, short: number, long: number }Phase = "title" | "howto" | "intro" | "playing" | "paused" | "won" | "lost"Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.