Phaser AE

Paddle and brick rules

Free packv3.0.0-32DArcade

One rules engine for every paddle-and-ball game: a two-player table-tennis duel, a four-sided free-for-all, a brick breaker or a capsule-collecting brick game with enemies. Every count, layout, timing and rule is configuration, and the classic arrangements are presets.

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

Released October 14, 2026 · updated October 20, 2026

Paddle and brick rules: 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

You build a game from a config and drive it with three calls: movePaddle places a paddle from your input, fire is the fire button (it serves, releases a caught ball or fires the laser), and tick advances the rules and returns a view of every ball, brick, capsule, enemy and shot to draw. Events since the last frame, a brick hit, a goal, a lost ball, a capsule caught, a round cleared, come from drain, ready for sounds and particles. The rules run in fixed 1/120 second slices, so a game behaves the same at any frame rate, and a snapshot and restore replay it exactly.

The ball is swept, not stepped. Contacts are found continuously within each slice, so even a very fast ball cannot pass through a brick or paddle between frames. Where it strikes the paddle sets the return angle, either through equal segments that each return at their own angle or as a continuous range, and a minimum travel angle keeps the ball off flat traverses. Every free ball shares one rally speed that rises by the rules you choose and never exceeds the cap.

The computer opponent drives a paddle through the same movePaddle call the player uses. It watches only balls coming its way within its attention distance, reacts after a delay, misjudges by an error that grows as the rally speeds up, moves no faster than its top speed, and can aim off-centre to return angled shots. Three presets are tuned so a simulated player wins about 96% of points on Easy, 60 to 65% on Normal and about 22% on Hard.

Features

  • Any field — any number of paddles on either axis, and each edge a wall, a goal for a team, or a drain that costs a life.
  • Swept contacts — continuous collision within 1/120 second slices, so balls do not tunnel at any supported speed.
  • Rally speed rules — speed-ups per paddle hit, per contact, per second, at set hit counts or on reaching certain bricks, always under a hard cap and reset on each serve.
  • Serves — from a paddle, the centre or a point, toward the loser, the winner, alternately or at random, on a timer or on the button.
  • Bricks and rounds — rounds authored as text rows with brickGrid, multi-hit and indestructible bricks, bricks that harden or score more in later rounds, and a choice to win or loop after the last round.
  • Seven capsules — slow, catch, expand, disruption (several balls), laser, break (opens the warp exit) and an extra life, with weights, drop chance and the rules on which can fall when.
  • Lasers, enemies and a warp exit — paired shots, enemies that drift down from hatches and deflect the ball, and an exit that ends the round for a bonus.
  • A fallible opponent — reaction time, attention, decision rate, aiming error, top speed and angled returns, with Easy, Normal and Hard presets that scale to any field.
  • Lives, scoring and extra lives — target scores, a winning margin, lives and extra lives at a first score and every so many points after.
  • Deterministic and headless — seeded, snapshot and restore, a landing-point prediction for any paddle, and no renderer needed.

Good for

  • Table-tennis duels in the style of the 1972 arcade Pong, against a friend or the tuned computer opponent.
  • Brick breakers in the style of the 1976 arcade Breakout, with speed-ups by row and a paddle that shrinks.
  • Capsule brick games in the style of the 1986 arcade Arkanoid, with power-ups, lasers, enemies and authored rounds.
  • Party variants, four paddles with every edge a goal, or vertical and horizontal paddles in one field.
  • Mobile brick games where the paddle follows the pointer and rounds are data you can ship and add to.
  • AI difficulty tuning, using the opponent's settings and the deterministic replay to measure how often a player wins.

Make it yours

Everything is part of the config: the field's size and edges, the paddles and their teams, the bricks or the round list, the speed rules and cap, how the ball rebounds, how serves work, whether a paddle shrinks when the ball reaches an edge, which capsules drop and how often, the laser, the enemies, the warp exit, lives, extra lives and the seed.

Three presets give you a ready start. pongPreset is an eight-segment paddle duel to 11 with speed-ups on the fourth and twelfth return. breakoutPreset is a 14 by 8 brick wall over two screens with a halving paddle, plus an atari2600 variant with six rows and five balls. arkanoidPreset has the colour scores, hardening silver bricks, indestructible gold, all seven capsules, enemies and five authored rounds that loop. Each preset takes options such as the round to start on, lives, a speed scale and capsule weights, and returns a plain config you can edit further.

A custom game is configuration too: four paddles on a square field, every edge a goal for the team opposite, first to five, with a random serve from the centre after a second.

A quick look

An Arkanoid-style game from its preset, driven from input and drawn from its view:

const pb = game.paddleBall;
const rules = pb.createPaddleGame(pb.arkanoidPreset({ startRound: 2, lives: 5, speedScale: 0.9 }));
rules.movePaddle('vaus', pointerX);
if (firePressed) rules.fire();
const s = rules.tick(dt);           // s.balls, s.bricks, s.drops, s.enemies, s.shots, s.score, s.lives …
for (const e of rules.drain()) if (e.kind === 'brick') sparkAt(e.x!, e.y!);

Works with

  • render-auto, world-screen and typography — beside it in the gallery's playable games, to draw the field, the bricks and the score. The rules themselves need no other pack.

Good to know

  • Paddles, bricks and balls are axis-aligned boxes; there is no spin and no transfer of the paddle's speed to the ball.
  • Enemies are circles that pass through one another, and the landing-point prediction ignores bricks and enemies.
  • Only the first five of the original 32 brick-game rounds are authored, and the final boss round is not included; the speed table, capsule odds and enemy paths are approximations from play.
  • Some arcade quirks are smoothed out and adjustable: table-tennis paddles reach the top of the screen, and the brick breaker re-serves for its second screen and finishes after it.

More Arcade packs

Show all →