The pack
autorunPlatformer2d
function autorunPlatformer2d():Pack<{autorunPlatformer2d:typeof rules}>
Install renderer-independent runner rules and generation.
Helpers
autorunStyles
const autorunStyles: readonly ["gardens", "terraces", "skyways", "switchbacks", "mixed"]
The course styles generateAutorun accepts.
compressAutorun
function compressAutorun(inputs: AutorunInput[]): AutorunFrame[]
Run-length encodes per-tick inputs into AutorunFrame runs of jump held or released, the form replay and a level's solution use.
createAutorun
function createAutorun(config: AutorunConfig)
One-button finite course rules over the public platformer motor.
generateAutorun
function generateAutorun(options: AutorunOptions): AutorunLevel
Builds a course from options and certifies it by replaying a planned route to the finish, trying up to 100 candidates. Throws if the seed, difficulty, style or sections is invalid, or if no candidate can be certified.
planAutorun
function planAutorun(config: AutorunConfig, maxFrames = 12000): AutorunFrame[] | null
Geometry-aware controller. Success is a physical witness; failure is not proof of impossibility.
Types
Autorun
type Autorun = ReturnType<typeof createAutorun>
A running autorun session, as returned by createAutorun.
AutorunConfig
type AutorunConfig = { … }
An authored course: the platformer-2d motor config, the opening run direction (default 1, rightward) and the optional pads.
platform: PlatformConfigdirection?: -1 | 1pads?: AutorunPad[]
AutorunFrame
type AutorunFrame = { … }
A run of identical inputs: input held for frames consecutive 1/60-second ticks (a whole number, 1 to 24000).
input: AutorunInputframes: number
AutorunInput
type AutorunInput = { … }
One tick of player input: jump is whether the single Jump button is held; omitted counts as released.
jump?: boolean
AutorunLevel
type AutorunLevel = { … }
A generated course with its certificate: the resolved options, the playable config, a winning input route that replays to the finish, and measurements of that route.
seed: numberparameters: Required<AutorunOptions>config: AutorunConfigsolution: AutorunFrame[]metrics: { frames: number; jumps: number; reversals: number; attempt: number; signature: string; sections: number; }
AutorunOptions
type AutorunOptions = { … }
Settings for generateAutorun: seed is an unsigned 32-bit integer; difficulty defaults to medium, style to mixed and sections (a whole number, 3 to 12) to a count derived from the seed and difficulty.
seed: numberdifficulty?: Difficultystyle?: AutorunStylesections?: number
AutorunPad
type AutorunPad = { … }
A pause or reverse pad: x and w give its span in pixels (w 8 to 200), y the standing surface height, and the first grounded touch triggers it once; direction is the run direction to leave in (-1 left, 1 right).
id: stringx: numbery: numberw: numberkind: 'pause' | 'reverse'direction?: -1 | 1
AutorunState
type AutorunState = PlatformState & { direction: -1 | 1; paused: boolean; pad: string | null; reversals: number; }
The platformer state plus the autorun additions: the current run direction, whether a pause pad is holding the run, the id of the last pad triggered, and how many times the direction has reversed.
AutorunStyle
type AutorunStyle = typeof autorunStyles[number]
One of autorunStyles.


