Phaser AE

Side-on world

Free packv3.0.0-42DWorld

The world for games seen from the side: platformers, runners, shooters, bat-and-ball games and wrap-around arenas. Depth is declared by layer and `z` rather than worked out from position, and the camera and coordinate conversions come installed.

This is a Free pack. Every phaser.io account can use it in their games.

Released October 14, 2026 · updated October 20, 2026

Side-on world: 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

Objects live on named layers, by default back, world and front, drawn back to front. Within a layer they draw by z, then in spawn order. Nothing is sorted by height on screen, because in a platformer a hero standing higher is not further away; you say what is in front.

It installs the shared 2D camera, with pan, zoom and bounds, and toWorld and toScreen to convert between screen pixels and world units, so a tap finds its place in the level. view, vw and vh give the rectangle the camera is looking at and points a fraction across it, read fresh each time so they are never a frame behind.

Set wrap and the world becomes a torus. Positions wrap, everything draws at its nearest image to the camera, the camera follows across the seam, and nearby-object queries and collisions see across it too. Game code never wraps a coordinate itself; the engine does it after every step.

Features

  • Declared depth — layer, then z, then spawn order, with no surprises from position.
  • Your own layers — name as many as the game needs; spawning on an unknown layer throws, so a typo is caught at once.
  • The 2D camera — pan, zoom and bounds, with toWorld and toScreen.
  • View helpers — view, vw and vh for placing things relative to what the camera sees.
  • Wrap-around worlds — wrap: { w, h } makes positions, drawing, the camera, queries and collision cross the edges.

Good for

  • Platformers — declared depth for scenery, level and foreground, with gravity and platforms from physics.
  • Endless runners — a camera that pans along with the runner across the level.
  • Horizontal and vertical scrolling shooters — layers for the backdrop, the action and the effects in front.
  • Brick breakers and bat-and-ball games — a fixed playfield with its depth set by layer.
  • Wrap-around space arenas — ships and rocks that fly off one edge and in at the other, in the style of Asteroids.

Make it yours

The options are the layer list and the wrap size. A platformer might declare its own layers for the sky, the distant hills, the level and the effects in front, with the camera bounded to the level and following the hero. A single-screen arena sets wrap to the size of the screen, so everything that leaves one edge comes back at the other, and the game never writes a line of wrapping code.

A quick look

A cloud behind, a hero over the same layer's other objects, and a tap converted into the world:

game.spawn({ id: 'cloud', x, y, layer: 'back' });
game.spawn({ id: 'hero', x, y, layer: 'world', z: 1 });  // over same-layer z:0
const p = game.input.pointer;                             // screen pixels
if (p) { const at = game.world.toWorld(p.x, p.y); /* … */ }

Works with

  • core-2d and core-vector — both compose it, so most 2D games have it already.
  • physics-2d — gravity and platforms; tiles-2d — a tilemap for the level.
  • rig-follow — the camera that follows the player; controls-2d — the input.
  • world-screen — a HUD over it, and an underlay that sits just above its first layer.
  • world-topdown — the alternative when characters should walk behind things by standing higher on screen.

Good to know

  • Two objects with the same layer and z draw in spawn order, and nothing reorders them.
  • Wrapping is all or nothing: a level that wraps only horizontally needs a wide world and a bounds clamp instead.
  • The 2D camera does not rotate.
  • There is one 2D world per game.

More World packs

Show all →