Phaser AE

Encounter director

Pro packv3.0.0-32DArcade

Timed plans of warned hazards across lanes, and a director that plays them. Every plan always leaves a lane to stand in, warns long enough to get there, and never puts more danger live at once than its budget allows.

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

Encounter director: 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

A plan is a timeline of cues. Each cue is a hazard of some kind that warns for a while, then is live for a while, over a set of lanes, and costs something against a budget. The director plays the plan: you tick it, ask which hazards are warning or live and how long until each changes, ask which lanes are safe, or ask whether a given lane is live right now. Events say when a phase starts, when a hazard warns, goes live and ends, and when the encounter is complete, each said once.

Fairness is the point. validateEncounter checks a plan at every moment a hazard goes live or ends: at least one lane must be free and the live cost must stay within the budget. It also checks that every hazard warns long enough for a body in the furthest lane to cross to safety, given how many seconds a lane takes to cross. The generator only lays hazards that keep the plan fair, and throws if the options cannot make one, so a generated encounter is beatable by construction.

Generation runs from a seed and a few options. Phases set pressure over the encounter, from a gentle probe to a hard finale, and pressure decides how many lanes a hazard takes, how soon the next follows and whether hazards overlap. An intensity raises every phase towards full pressure, so one setting turns an encounter from easy to hard. What a lane is in your world, a column, a ring or a road, and what a hit does, are up to your game.

Features

  • Fair by check — a safe lane at every moment, warning long enough to reach it from the furthest lane, and the budget kept, for generated and hand-written plans alike.
  • Seeded generation — lanes, length, budget, least warning, lane crossing time and calm between hazards as options, with ranges picked by seed.
  • Hazard kinds as data — cost, live duration, weight and lane shape: side by side, scattered or every other lane.
  • Phases and intensity — named stretches with their own pressure, and one dial to raise them all.
  • A director to play it — what is warning, what is live, safe lanes, time left on each hazard and the current phase.
  • Events said once — phase, warning, active, ended and complete.
  • Snapshot and restore — save and return to a time in the encounter.

Good for

  • Boss fights whose beams, slams and sweeps are telegraphed across an arena floor.
  • Lane-based gauntlets, such as a runner's laser gates or a road of charges.
  • Bullet-hell lanes, where the danger comes in strips rather than single shots.
  • Rhythm and dodge games with hazard rows on a timeline.
  • Difficulty curves by setting, raising intensity per level while every encounter stays fair.

Make it yours

The generator takes the seed, the number of lanes or a range of them, the duration, the budget, the least warning, the time to cross a lane, the calm between hazards, the hazard kinds, the phases and the intensity. The built-in kinds are a beam that takes side-by-side lanes, a pulse that scatters and a costlier charge on alternate lanes; the built-in phases are probe, pressure and finale. Replace any of them with your own, or skip generation and write the cues by hand, then run them through the validator.

Two different encounters from one pack: a forty-second boss floor of six lanes, gentle at first and closing to a finale of overlapping beams; and a short, harsh gauntlet of a dozen lanes with one kind of wide sweep, a small budget, a long warning for a slow hero, and intensity at full.

A quick look

A generated encounter played each frame, hurting the hero in a live lane and drawing warnings:

const director = createEncounter(generateEncounter({ seed: 7, lanes: 6, intensity: 0.5 }));
director.tick(dt);
if (director.live(laneOf(hero.x))) hurt(hero);
for (const h of director.hazards()) drawLanes(h.lanes, h.active ? 'burning' : 'warning', h.left);

Works with

Good to know

  • Lanes are a line of equal strips, from 2 to 100 of them; what a lane is in the world is your game's.
  • A plan is fair for a body that crosses a lane in the plan's lane time; give a slower one more warning.
  • The director keeps time, not state: restoring returns to a time, and events from there are said again.
  • It draws and moves nothing, and decides nothing about damage.

More Arcade packs

Show all →