Phaser AE

Falling-boulder caves

Pro packv3.0.0-12DArcade

The rules of the falling-rock cave game: dig through dirt, collect enough diamonds to open the exit, and keep out from under the boulders. The cave simulates itself a cell at a time round the player, and caves are data you can write or generate.

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

Released October 19, 2026

Falling-boulder caves: 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

Each cave frame scans the cave from the top left, and every object acts once. Boulders and diamonds fall into empty space and roll off anything round, boulders, diamonds and brick, when there is room beside them. A falling one kills the player or a creature it lands on; one resting on the player does no harm until they step out from under it. Fireflies keep a wall on their left and butterflies on their right, and either explodes beside the player or the amoeba, a firefly into empty space and a butterfly into diamonds. The amoeba grows slowly and then fast, turning to diamonds when it is walled in and to boulders when it grows too big. A magic wall wakes when something falls on it and passes boulders through as diamonds and diamonds as boulders until it expires.

The player digs dirt, collects diamonds, pushes a boulder sideways into space now and then, and can snap, digging or collecting beside them without moving. When the cave's quota is collected, the exit, hidden as steel until then, opens, and leaving by it scores a bonus for the time left. Time runs down, and a lost life restarts the cave.

The game draws nothing. view gives every cell and which ones are falling, and drain gives events, dig, collect, push, thud, explode, open, exit, die with its cause, and more, for sound and effects. The whole game snapshots to plain JSON and restores, and an autopilot walks to the nearest safe diamond for an attract mode or a test.

Features

  • Cell-by-cell simulation — a top-left scan each frame, with every object acting once.
  • Falling and rolling — boulders and diamonds fall, roll off round things and crush what they land on.
  • Creatures — fireflies and butterflies that follow walls and explode, butterflies into diamonds.
  • Amoeba — slow then fast growth, turning to diamonds when enclosed and boulders when too large.
  • Magic walls — boulders become diamonds and diamonds boulders while the wall runs.
  • Digging, pushing and snapping — with a push chance per frame and snap to act without moving.
  • Quota, exit and timer — the exit opens at the quota, with a time bonus and extra points per diamond past it.
  • Caves as data — a text map or a seeded fill with lines, boxes and points drawn over it; five caves built in.
  • Events, snapshots and validation — every rule reports itself, saves are checked before restoring, and options are validated with every fault listed.
  • Autopilot — a safe breadth-first walker that clears the first four built-in caves.

Good for

  • Dig-and-collect cave games in the style of Boulder Dash, with quotas, timers and lives.
  • Puzzle-first falling-rock caves, drawn by hand in text, in the style of Repton.
  • Procedural cave runs, using seeded fills with different boulder, diamond and creature chances.
  • Attract modes and demos, with the autopilot playing a cave by itself.
  • Puzzle editors, since a cave is a few rows of text and the validator explains every mistake.

Make it yours

A cave sets its diamond quota, points per diamond and per diamond past the quota, and its time. Its layout is either a text map, with a letter per tile, or a size, a seed, fill chances for boulders, diamonds, space, fireflies and butterflies, and walls drawn over it as lines, boxes and points with a start and an exit. The amoeba's slow time and size limit and the magic wall's duration are per cave. The game takes the caves, the starting cave, lives, the length of a frame, the push chance and the amoeba's growth chances.

Two materially different uses: a hand-made puzzle cave drawn in text, with a few boulders balanced over a magic wall and a tight quota; and a fast generated cave of 40 by 22 cells, a seeded fill rich in diamonds and fireflies, a shorter frame for quicker play and five lives.

A quick look

A game with three lives, driven by held keys and drawn from its view:

const bd = game.boulderDash.create({ lives: 3 });
bd.move(keys.dir);
bd.snap(keys.fire);
bd.step(dt);
const v = bd.view();
v.cells.forEach((cell, i) => drawCell(cell, i % v.width, Math.floor(i / v.width)));

Works with

  • chips-challenge — for tile-effect puzzles with keys, doors, ice, water and fire.
  • excavation and dig-combat — for free-form tunnelling through earth, with rocks that fall when undermined and enemies to pump or harpoon.
  • tiles-2d — to draw the cave as a tilemap.

Good to know

  • One player: the original's intermission caves, difficulty levels and two-player turns are not modelled.
  • Expanding walls, slime and the later games' objects are not in the set.
  • The autopilot does not use magic walls or trap butterflies on purpose, so it does not clear every cave.
  • The pack draws nothing and plays no sound; your game presents the view and the events.

More Arcade packs

Show all →