The runtime
Core
42 symbols, imported from @driftengine/core.
Explained in The loop.
Classes
BrowserStorelocalStorage, 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.
MessageQueueOnceSet- 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.
RemoteSaveStoreStepBudgetTickTrace
Interfaces
FrameSource- A source of animation frames.
windowsatisfies it, and so does anXRSession. KeyValueStore- Where persisted state goes.
LoadSummaryLoadTask- One thing being waited for.
LoopHooks- Fixed-timestep game loop with render interpolation.
LoopOptionsMessageQueueOptionsPreferenceSchema- Persisted player preferences: a validated record in a
KeyValueStore. QueuedMessage- One transient message at a time, in priority order.
RemoteSaveOptionsSavableRandom- 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.
TimeCurveTimeCurveOptions
Functions
curveOffsetSec- Source seconds elapsed by
localSecinto the curve. curveSpanSec- Source seconds a whole segment consumes —
durationSecfor 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.
loadPreferencesmulberry32pickBySeed- Deterministically choose one item from a list.
savableMulberry32savePreferencesstartLoop- 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.