Phaser AE

Maze chase

Free packv3.0.0-32DArcade

The rules of a dot-eating maze chase, deterministic and drawn by you in any style. The 1980 arcade game is one preset, with its maze and level table; a generator that builds a fresh maze every level is another; and every count, layout, speed and timing is data.

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

Released October 14, 2026 · updated October 19, 2026

Maze chase: 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.

What it does

You feed the game a direction and tick it. Input is buffered and taken as soon as it is legal, including the arcade's cornering, where a turn pressed just before or just after a junction cuts the corner. Actors slide off one edge of a wrap tunnel and in at the other. Eating a dot or an energizer pauses the player briefly, as the original did.

The ghosts are the heart of it. Each has a personality: one targets the player's tile, one aims a few tiles ahead, one uses a vector from the first ghost to a point ahead of the player, and one chases until close and then retreats to its corner. They follow a timetable of scatter and chase, reverse on every change, decide one tile ahead and never reverse by choice. An energizer turns them frightened, flashing before it ends, and eaten ghosts go home as eyes and revive. A ghost house holds them at the start, releasing each by its own dot counter, a shared counter after a lost life, or a timer if the player stops eating. As the dots run low the lead ghost speeds up in two steps.

Everything around the chase is included: bonus fruit at dot thresholds, rising scores for ghosts eaten in one frightened spell, lives, an extra life, deaths, game over and level progression through a table that changes speeds, frightened time, fruit and release counters level by level. The state tells a presenter what to animate and for how long: the ready pause, a death, a captured ghost's score, a maze flashing at the end of a level.

Features

  • Arcade cornering — buffered turns with pre-turn and post-turn windows, and the original's asymmetry when moving left or up.
  • Four ghost personalities — chase, ambush, vector and shy, plus random, each with its own scatter corner, look- ahead and distance.
  • Scatter and chase timetables — with reversals, frightened time, flashes and the energizer's pause of the clock.
  • The ghost house — personal and global dot counters, a release timer, a scripted exit, and eyes that route home and revive.
  • The late-game speed-up — the lead ghost's two elroy speed steps at dot thresholds.
  • Fruit, scores and lives — fruit by level, ghost score combos, extra lives and a score goal as an alternative to clearing the board.
  • Level tables — any field patched per level, including per-ghost settings, with the last row repeating.
  • A maze generator — seeded connected mazes of odd sizes from 9 to 199, with extra loops, tunnels, an optional ghost house and energizers, regenerated every level.
  • Gates and keys — doors and keys in your own mazes, with gates opened and closed by setGate.
  • Deterministic — fixed 120 Hz steps, snapshots and a seed.

Good for

  • Dot-eating maze chases in the style of the 1980 arcade Pac-Man, with rules taken from its published research.
  • Maze games with your own layouts, more or fewer ghosts, several tunnels, or no ghost house at all.
  • Endless maze chases, with a new generated maze every level.
  • Score-attack variants, where the goal is a target score rather than clearing the board.
  • Hybrid grid games — a maze with breakable walls and bombs, or gates and keys.
  • AI teaching and experiments, since ghost targets can be queried and every rule replays exactly.

Make it yours

A configuration is plain data: the map as rows of text (walls, dots, energizers, house and door), the starts, the ghosts with their personalities, corners, release counts and speeds, the house, the tunnels, no-turn tiles, gates and keys, the fruit, every speed and timing, the cornering windows, the scoring, lives and goal. A level table patches any of it per level, and a generator can rebuild the maze each time.

Two presets show how far apart the games can be. mazePreset('classic') is the 28 by 31 arcade maze with 240 dots, four energizers, a tunnel that slows ghosts, four ghosts with the house, and the original's 21-row level table. mazePreset('garden') builds a seeded maze of your chosen size, ghost count, loops, tunnels, house and energizers, behind a gentler level table, and builds a new one every level. A maze game with two ghosts, three tunnels and a 5,000-point goal is simply another configuration.

A quick look

The classic preset at level 1, a buffered turn, a tick, and a sprite snapped when it wraps through a tunnel:

const mc = game.mazeChase;
const maze = mc.createMazeChase(mc.mazePreset('classic', { level: 1 }));
maze.input('up');          // taken as soon as it is legal, cornering included
const s = maze.tick(dt);   // fixed 120 Hz steps inside; returns a copy of the state
for (const e of maze.drain()) if (e.kind === 'portal') sprite.snap();

Works with

  • grid-walker — moves every actor tile to tile, with edge portals; a package dependency.
  • grid-bombs — puts a bomb field on the maze, with breakable walls and ghosts that die in the flames.
  • typography — for the score, lives and READY! banner.
  • snake — for a grid game where the player is a growing trail instead.

Good to know

  • It reproduces the researched rules and tables at 120 Hz; it is not a ROM emulation, and movement is continuous rather than the original's per-frame speed patterns.
  • Contact uses centre distance, so the original's pass-through bug does not happen unless you choose tile collision.
  • The kill screen at level 256 and the intermissions are not modelled.
  • Every dot and energizer must be reachable from the player, and generated mazes must have odd sizes.
  • It draws nothing: your game presents the state and events.

More Arcade packs

Show all →