Phaser AE

Title, pause and game over

Free packv3.0.0-42DLogic

The title, pause and game-over scenes that every game has and nobody wants to write again, with the score and best score that thread through them. Your game registers a `play` scene, and from the first build a player can start it, pause it, die, see their score and try again.

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

Released October 14, 2026 · updated October 20, 2026

Title, pause and game over: 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.

The pack

flow

function flow(opts: FlowOptions = {}): Pack<{ flow: FlowApi }>

The flow pack: a title, a game over and a pause menu as real scenes, with the score and best score that thread through them. Requires world:screen and the typography pack. Composing it alongside a game that registers its own title is a loud error — rename flow's with names.

Types

FlowApi

interface FlowApi

game.flow.

  • score: number — The run's score. Setting it beats the best if it should.
  • readonly best: number — The best score seen; persisted through save when that pack is composed.
  • add(n: number): number — Add to the score and return the total.
  • start(): void — Start a run: zero the score and go to the play scene.
  • end(win?: boolean): void — End a run: to the game-over scene, which says YOU WIN when win.
  • readonly paused: boolean — True while the pause scene is on top.
  • pause(on?: boolean): void — Push or pop the pause scene.
  • readonly won: boolean — Did the last run end in a win — what the game-over scene reads.

FlowNames

interface FlowNames

What the scenes are called, so a game with its own title can rename flow's rather than colliding.

  • title?: string — The title scene. Default 'title'.
  • gameOver?: string — The game-over scene. Default 'gameOver'.
  • pause?: string — The pause scene, pushed over play. Default 'pause'.
  • play?: string — The scene a start goes to. Default 'play'.

FlowOptions

interface FlowOptions

Manifest options.

  • heading?: string — The big word on the title. Default 'GAME'.
  • subtitle?: string — A line under it. Default none.
  • prompt?: string — What to press. Default 'PRESS SPACE', or 'TAP TO START' on a touch device.
  • scenes?: ReadonlyArray<'title' | 'gameOver' | 'pause'> — Which scenes to register. Default all three.
  • names?: FlowNames — Scene names, for a game that already owns one of them.
  • confirmKeys?: ReadonlyArray<string> — Key codes that start, confirm and dismiss. Default Space and Enter.
  • pauseKey?: string — Key code that pushes and pops the pause scene. Default 'Escape'.
  • tint?: string — Text colour. Default '#e6e9f5'.
  • dim?: string — Dimmer colour for secondary lines. Default '#8a93b5'.
  • layer?: LayerName — The layer to draw on. Default 'hud', or the last layer.
  • bestKey?: string — Where the best score is kept, if save is composed. Default 'best'.