What it does
A ShooterConfig describes a whole game: the screen and scroll axis, the ship, its guns and pickups, the enemy kinds,
their paths, the terrain and the stages. You step it with the player's input (a stick, a touch target, fire, bomb,
select and evade), drain its events, read its state and draw what it holds. It runs headless at a fixed step and is
deterministic for a seed and an input sequence, and a snapshot carries the restart point and the random stream, so a
restored game carries on exactly as the original would have.
A stage is a script of entries fired once, at a scroll distance or a stage time: start a wave, change the scroll speed (zero holds it), mark a checkpoint, show a label. Ground waves fired late are placed where they would have been, so a rewound restart shows the right turrets. A dead-air guard starts filler waves whenever the screen has been empty for too long, however fast the player clears the authored ones. Terrain is a floor and a ceiling along the scroll, collidable and fatal, and ground enemies ride, walk and hop along it.
Enemies are air or ground targets, and every shot lists the layers it hits, so air shots fly over tanks and only a lobbed bomb reaches them. Enemies move along paths, in straight, homing or ballistic lines, on the ground, in darts, or to a station where they sway or track the ship, and fire volleys from the projectile patterns pack. Bosses are built from parts: armour that absorbs, guards that must fall before the core takes damage, and time limits after which they leave. On the player's side, volleys respect live-shot limits, missiles hug the floor, lasers grow from the muzzle and pierce, Options copy every volley from the ship's recorded path, side fighters fly in formation and can be shot away, a shield blocks from the front, and limited evade charges make the ship untouchable for a moment.
Features
- Two scroll axes — vertical or horizontal, with the ship's own forward frame so one gun table works on either.
- Stage scripts — waves, scroll speed changes, checkpoints and labels keyed to distance or time, with a dead-air guard.
- Collidable terrain — floor and ceiling heightfields with ground enemies that ride, walk, chase and hop on them.
- Air and ground layers — shots that hit only the layers they list, and bombs that land on ground targets.
- Enemy motion and fire — paths mirrored per wave, homing, ballistic, darting and station-keeping enemies, with patterned, aimed or leading fire.
- Spawners and bosses — hatches and vents that launch children, and bosses whose guarded core dies last.
- Weapons — volley guns, floor-hugging missiles, growing piercing lasers and lobbed bombs.
- Power-ups or a power meter — direct pickups with fallbacks, or a wrapping meter whose lit slot the player selects.
- Options and wingmen — satellites that trail the ship's path, and escorts at fixed slots that fire with it.
- Lives and restarts — in-place or checkpoint respawn, losing chosen parts of the loadout, extra lives by table.
- Progression — stage tallies, numbering up or down, loops that ramp difficulty, a hidden rank and bonus waves.
- Deterministic saves — snapshot and restore including the random stream and restart point.
Good for
- Vertical war-plane shooters with loops, side fighters, red formations and a shoot-down tally, in the style of 1942.
- Horizontal space shooters with a power meter, Options, missiles, lasers and a core boss, in the style of Gradius.
- Ground-and-air shooters where bombs reach tanks and turrets that air shots fly over, in the style of Xevious.
- Cave runs with a floor and ceiling to avoid and ground targets on them.
- Mixed designs, such as a horizontal war-plane game or a vertical meter shooter, by swapping axes and tables.
- Mobile shooters steered by a touch target rather than a stick.
Make it yours
The pack factory has no options; everything is the definition passed to createShooter. preset1942 takes lives,
the extra-life table, difficulty, loops, the stage list, whether a boss ends every stage and a seed, and any field can
then be replaced: the ship's speed and hit box, the gun table, side-fighter slots, loop charges, items, enemy kinds,
paths, scores, scripts, restart points, the tally table and the difficulty ramp. gradiusPreset takes lives, the
number of Options, speed steps, shield hits, autofire, the extra-life table and a seed. Each preset's parts (paths,
kinds, items, stages, the meter and the terrain) are exported for reuse, and route and arcSegments help author
paths.
Beyond the presets, the pack has been exercised as a vertical game with a canyon whose walls are left and right, walkers on the right-hand wall, tanks only a lobbed bomb can hit and in-place respawn; and as a horizontal shooter with direct pickups, side fighters, an evasive roll and a time-keyed script.
A quick look
A game from a preset, stepped and drawn:
const ss = game.scrollingShooter;
const g = ss.createShooter(ss.preset1942()); // or ss.gradiusPreset(), or your own ShooterConfig
g.tick(dt, { x, y, fire, evade }); // touch: { to: { x, y }, fire }
for (const e of g.drain()) present(e); // stage-start, enemy-killed, power-up, player-hit, stage-clear...
const s = g.state; // player, enemies, shots, bullets, items, score, lives
for (const col of g.terrainColumns(2)) drawColumn(col);
Works with
route— supplies the terrain envelope; it need not be in your manifest.projectile-patterns— aimed, fan, ring, burst and staged enemy volleys.path-notation— the path notation enemy routes are baked from.world-screenandtypography— a fixed screen to draw on, and the score and banners.marching-fleetorflight-formation— for fixed-screen formation shooters instead.wave-arenaorasteroid-field— for free-roaming arena shooters instead.
Good to know
- Terrain has no overhangs and cannot be destroyed. After a checkpoint rewind, fixed ground objects return but walkers and flyers that were on screen do not.
- Collision boxes are axis-aligned; shots sweep against them each step.
- The 1942-style preset loops three authored stages with rising difficulty rather than playing 32 distinct ones, and the Gradius-style preset authors its first stage only, which loops; speeds, fire rates and hit points in both are estimates.
- It is not for pseudo-3D rail shooters; see
scaler-runnerorrail-route.






