The runtime

Core

42 symbols, imported from @driftengine/core.

Explained in The loop.

Classes

BrowserStore
localStorage, with every access guarded.
LoadTracker
What an app is waiting on, as one weighted number.
MemoryStore
Volatile store: the test double, and the fallback when nothing persists.
MessageQueue
OnceSet
A persisted set of one-time flags: tutorial prompts, first-run hints, "you have seen this" markers.
PreferenceStore
A live preference record: the loaded value, validated updates, persistence and change notification for whatever applies them to running systems.
RemoteSaveStore
StepBudget
TickTrace

Interfaces

FrameSource
A source of animation frames. window satisfies it, and so does an XRSession.
KeyValueStore
Where persisted state goes.
LoadSummary
LoadTask
One thing being waited for.
LoopHooks
Fixed-timestep game loop with render interpolation.
LoopOptions
MessageQueueOptions
PreferenceSchema
Persisted player preferences: a validated record in a KeyValueStore.
QueuedMessage
One transient message at a time, in priority order.
RemoteSaveOptions
SavableRandom
A generator whose position can be read and written.
SaveBackend
The asynchronous side, which the consumer implements.
SaveTimer
The delay, taken as a capability rather than reached for.
StepBudgetOptions
Spending a slice of a frame on work that can stop, without spending more than the slice.
TickTraceLike
What a fixed-step simulation produced, tick by tick.
TimeCurve
TimeCurveOptions

Functions

curveOffsetSec
Source seconds elapsed by localSec into the curve.
curveSpanSec
Source seconds a whole segment consumes — durationSec for every kind, and worth asking for rather than assuming: a caller composing segments needs the answer the curve actually gives, not the one it promises.
defaultSaveTimer
The global timer where there is one, and a timer that never fires where there is not.
defaultStore
The default store: the browser's when it works, memory when it does not.
hashToUnit
A single well-mixed value in [0, 1) from one integer seed.
linearCurve
A curve that does nothing, for a segment that is played straight.
loadPreferences
mulberry32
pickBySeed
Deterministically choose one item from a list.
savableMulberry32
savePreferences
startLoop
Starts the loop immediately. Returns a stop function.
timeCurve
Build a curve, validating at construction.

Types

SaveStatus
What the queue is doing, for an indicator a player can read.
TimeCurveKind
Re-timing a stretch of playback: how much source time one second of clip time is worth.

Constants

MAX_TIME_CURVE_AMOUNT
Ceiling on amount.