Phaser AE

Autorun Platformer 2D

Pro packv3.0.0-42DArcade

One-button platforming: the hero runs by themselves, turns at walls and the player only jumps. Seeded courses come with a recorded input route that reaches the finish, so every generated level is known to be beatable.

This is a Pro pack. Upgrade to Phaser Pro to use it in your games.See Phaser Pro →

Released October 14, 2026 · updated October 19, 2026

Autorun Platformer 2D: a screenshot of its demo
A note about these graphics

Expansion packs don't come with graphics. This screenshot is one way of drawing what the pack does, made for its demo: none of the sprites, tiles or backgrounds in it are in the pack.

That's by design. A pack is a game's logic, mechanics and effects, and it works with whatever art you give it. Some packs draw effects, backdrops or 3D scenes of their own, but none carries a game's sprites.

So the look is yours. Make the art on phaser.io, bring your own, or let your agent draw it in code: the same pack can look like anything.

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: PlatformConfig
  • direction?: -1 | 1
  • pads?: 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: AutorunInput
  • frames: 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: number
  • parameters: Required<AutorunOptions>
  • config: AutorunConfig
  • solution: 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: number
  • difficulty?: Difficulty
  • style?: AutorunStyle
  • sections?: 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: string
  • x: number
  • y: number
  • w: number
  • kind: '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.