Phaser AE

Cell dungeon map

Pro packv3.0.0-0LogicNew

The map under a first-person corridor game or a grid dungeon crawler. You write it as rows of characters; it runs the doors and secret walls and answers every question about walls, sight and paths.

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

Released October 24, 2026

Cell dungeon map: 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 character in the rows means a cell: floor, wall, door, secret wall or switch, with a picture name for whatever draws it, a key for a locked door, an action for a switch, or a thing standing on the floor with a facing. The map keeps the moving parts going. Doors slide open when used, stay open a while and close again, but wait while any body is in them. A pushed secret wall slides straight away from you for a few cells and settles as an ordinary wall.

It also answers the questions a game asks constantly. Collision moves a round body along walls without ever trapping it in a door that closed on it. A ray reports the cell, the side and the position along the face, which is what a raycaster needs to texture a column. Sight checks an unbroken line, hearing floods through open floor and open doors, and paths find the shortest walk with doors open, unlocked or all.

A map can carry its own lighting too: lamps, torches and glows placed by position, with colour, brightness, reach and flicker, each on or off and switchable by tag. They are plain data beside the walls, so a level and its mood travel together; the presenter turns them into real lights and draws a fitting for each.

Features

  • Rows and a legend — maps you can read and write by hand, or generate, with things placed by position.
  • Sliding doors — speed and hold time are settings, and a door never closes on someone in it.
  • Locks and keys — a door can need a named key; using it without one says which.
  • Secret walls — pushed walls slide back a set number of cells and settle where they stop.
  • Switches — report their action, such as ending the floor.
  • Lights in the map — lamps, torches and glows with colour, reach and flicker, switched on and off by tag.
  • Collision, rays and sight — sliding movement, textured-column rays and line of sight.
  • Hearing and paths — how far a noise carries through open doors, and shortest walks for enemies.

Good for

  • A first-person corridor shooter — corridor-shooter is built on it.
  • A raycaster — rays give the cell, side and texture position.
  • A grid dungeon crawler in real time — doors, keys, secrets and switches are all there.
  • A stealth game — sight lines and hearing for guards.

Make it yours

Any characters, any pictures, doors with or without keys, door speed and hold, how far secrets slide and how fast, and as many lights as the level wants. A hand-written maze with a gold door and no lights at all is one use; a generated floor of lamp-lit rooms with torches in the corridors and a glow spilling out of each hidden closet is another.

A quick look

Build a map, move a body, and use what is ahead.

const map = cellDungeon.createCellDungeon({ rows, legend });
const to = map.collide(x, z, dx, dz, 0.3);
map.use(to.x, to.z, yaw, ['gold']);
map.tick(dt, (cx, cz) => someoneIn(cx, cz));

Works with

Good to know

  • One level of square cells: no heights or angled walls.
  • Up to 128 by 128 cells; ask for paths a few times a second, not every frame for every enemy.
  • It draws nothing; read its cells, doors, moving walls and lights to draw them.
  • Lights cast no shadows, and a renderer shades only so many at once, so spread them through the rooms.

More Logic packs

Show all →