Phaser AE

Paths and walkers

Free packv3.0.0-32DLogic

Anything that travels a route: an enemy on a shooter's waveform, a platform on a loop, a boss on a spiral, a camera on a spline, a projectile on an arc. One call moves an object along a curve at an even speed, turning to face where it is going if you like.

This is a Free pack. Every phaser.io account can use it in their games.

Released October 14, 2026 · updated October 19, 2026

Paths and walkers: 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

path

function path(): Pack<{ path: PathApi }, PathTopics>

The path pack: walkers along any geometry shape (baked by arc length so speed is even), and follow to drive objects by them. Headless.

Types

PathApi

interface PathApi

game.path.

  • walker(shape: Shape, opts?: WalkOptions): Walker — A headless walker on a shape: the game reads x y angle and does what it likes with them.
  • follow(h: Handle, shape: Shape, opts?: WalkOptions): Walker — Drive h along shape each step until it ends or is stopped; the walker is returned and the object is moved (and rotated with align). Scene-scoped; a second follow on the same object replaces the first.
  • stop(h: Handle): void — Stop driving h. Safe when it is not followed.
  • walkerOf(h: Handle): Walker | null — The walker driving h, or null.
  • readonly count: number — Objects being driven.

PathTopics

interface PathTopics

Signals, once per step.

  • 'path.end': { id: string } — A followed object reached the end of its path (loop 'none').
  • 'path.lap': { id: string; laps: number } — A followed object wrapped or turned (loop / yoyo).

Walker

interface Walker

A position moving along a curve. update(dt) advances it; follow calls that for you each step.

  • t: number — Progress along the curve, 0..1 by length (after the ease). Set it to jump.
  • readonly x: number — Current x.
  • readonly y: number — Current y.
  • readonly angle: number — Direction of travel, degrees.
  • readonly distance: number — World units travelled this pass.
  • readonly length: number — The curve's length.
  • readonly done: boolean — Finished (loop 'none' reached the end).
  • readonly laps: number — Passes completed (loop or yoyo turns).
  • readonly reversed: boolean — Moving backwards (yoyo's return leg).
  • paused: boolean — Hold.
  • speed: number — Live speed, units/s.
  • update(dt: number): boolean — Advance by dt seconds. Returns true while moving.
  • reset(): void — Back to the start (or at).

WalkOptions

interface WalkOptions

How a walker moves.

  • speed?: number — World units per second along the curve. Default 100.
  • duration?: number — Or: seconds for the whole curve (overrides speed).
  • loop?: 'none' | 'loop' | 'yoyo' — What happens at the end: stop, wrap to the start, or turn back. Default 'none'.
  • ease?: EaseName | EaseFn — An ease over each pass (by duration or by length at speed). Default linear.
  • at?: number — Start this far along, 0..1. Default 0.
  • relative?: boolean — The curve is relative to the walker's start point (its handle's position when follow begins). Default false: world coordinates.
  • align?: boolean — Set the followed object's rotation to the direction of travel (+ alignOffset degrees). Default false.
  • alignOffset?: number — Degrees added when aligning. Default 0.
  • samples?: number — Arc-length samples for the bake. Default 128 (more for long or wiggly curves).
  • paused?: boolean — Start paused. Default false.