Phaser AE

Cave flyer

Pro packv3.0.0-32DArcade

The session of a cave-flying thrust game: fly a heavy ship down into a planet against gravity, deal with the guns that defend it, do the job and get back out to orbit. What the job is, is a rule you choose or write, so one session plays several classic designs and your own.

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

Released October 14, 2026 · updated October 20, 2026

Cave flyer: 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 game is a definition: the ship, the planets, the kinds of base, flyer and shot, the rules, lives and scoring. The session steps it one fixed frame at a time from the player's input, turn, thrust, fire, shield, bomb and recharge, over the thrust-craft flight model, with its gravity, fuel, terrain contact and towed loads. Each planet has its terrain, its gravity, an orbit line to leave by, and the bases, flyers, fuel cells, doors, switches and teleporters you place on it. The state, the planet's world and a stream of events are there for your presenter, and the whole session snapshots and restores.

The ship is configured piece by piece. Its gun sets speed, life, how many shots fly at once and whether fire repeats. Its shield can burn fuel while held or run on a charge that drains, takes hits and is recharged for fuel, and you choose whether it blocks bullets, ground and enemies, and whether the same key works the beam. The tractor beam drains fuel cells over time or lifts them whole. Bombs have a count, a blast radius and a detonation rule. Bases are boxes with hit points and scores that fire cones or aimed shots with lead, launch flyers, pull like gravity wells, pop up or refuel a ship that hovers beside them. Flyers home in while steering round the rock.

Objectives are rules. A rule is an object with hooks into each part of the step, entering a planet, bullets, blasts, collisions, deaths, respawn points, leaving by orbit, what the view follows, and its state lives in the session so a snapshot saves it. clearBasesRule is built in: destroy every base, then leave by orbit for a bonus. The reactor and the towed pod come from thrust-rules, rescues and the mothership from oids-rescue, and a game can write its own.

Features

  • A complete ship — turning, thrust, drag, a speed cap, fuel, optional landing gear, a gun, a shield, a tractor beam, bombs and passenger room.
  • Shields two ways — fuel burned while held, or a charge with hits and a quick, dearer recharge.
  • Defences — bases with guns that fire cones, aimed or scaled shots on a timer or by chance, pop-up towers, flyer launchers and gravity wells.
  • Flyers and shots — homing flyers with rock avoidance, and projectiles that home, have a radius and can be shot down.
  • Fuel — cells drained or collected by the beam, and fuel bases that refill a hovering ship.
  • Doors, switches and teleporters — doors that morph between two outlines when a switch is shot.
  • Missions and loops — rising gun levels per mission, reverse gravity, an invisible landscape, endless play.
  • Rules with hooks — objectives as objects called at each part of the step, with their own saved state.
  • Clear-the-bases rule — built in, with the kinds that count, a bonus, and whether leaving early costs a life.
  • Followed view — a dead zone, catch-up and lead, plus helpers for drawing across a wrapping planet's seam.
  • Deterministic — fixed-step, seeded and snapshot-able, with every event reported.

Good for

  • Cave-flying shooters in the style of Gravitar, where every base on a planet must fall before you leave.
  • Tow-the-pod games in the style of Thrust, with a reactor to shoot and a pod to haul out, through thrust-rules.
  • Rescue missions in the style of Oids, with survivors to collect and a mothership to dock with, through oids-rescue.
  • Gravity-well shooters where bases pull the ship as well as shoot it.
  • Your own cave missions, such as fetching fuel cells against a timer, written as a new rule.

Make it yours

Every part of the game is in its CaveFlyerDef: the ship's handling, fuel, gun, shield, beam and bombs; each planet's size, wrapping, gravity, terrain, start, checkpoints, orbit line and contents; the base, flyer and projectile kinds by name; the rules in order; lives, scoring and extra ships; gun levels per mission; modifier loops; and the view and timings. Terrain is any thrust-craft terrain: outlines, polylines, heightfields or tile masks, with landable ground marked.

Two materially different games: a clear-the-bases campaign with wrapping planets, aimed-fire bunkers worth 250 points, a shield that burns fuel and a beam that lifts fuel cells whole; and a tow-the-pod game with no landing gear, so every touch of the ground crashes, a shield that also works the beam, a reactor to stun and a pod to haul out through reverse-gravity loops.

A quick look

A single planet under the clear-the-bases rule, stepped with input:

const CF = game.caveFlyer;
const g = CF.createCaveFlyer({
  rules: [CF.clearBasesRule({ bonus: 1000 })],
  ship, planets: [planet], lives: 3,
  bases: { bunker: { w: 12, h: 10, hp: 2, score: 250, fire: { aim: 'aimed', rate: 1, projectile: 'pellet' } } },
  projectiles: { pellet: { speed: 90, life: 2 } },
});
g.start({ planet: 0, loop: 0 });
g.step({ turn, thrust, fire, shield, bomb, recharge });
for (const e of g.drain()) { /* planet, fire, destroyed, crash, cell, door, escape, blast … */ }

Works with

  • thrust-craft — the flight model every planet runs on; use it alone for free flight with no rules.
  • thrust-rules — the reactor, the towed pod, checkpoints and a six-planet preset.
  • oids-rescue — factories, walkers boarding the ship, the mothership and the journey between planets.
  • lander-missions — for landing-only games with pads, fares and tips.

Good to know

  • One ship and one player.
  • Bases are axis-aligned boxes, and flyers steer by raycast avoidance rather than pathfinding, so in tight caves they rebound off the rock.
  • Bullets are tested at the end of each step, so targets should be wider than a bullet moves in one step, about three to four units at 60 Hz.
  • Teleporters carry the ship but not bullets or bombs, and a closing door does not push the ship.
  • Planets come in the definition's order; choosing them from a map of a solar system is not modelled.

More Arcade packs

Show all →