← Back to games

Brick Breaker

Arcade brick breaker with trajectory-preview aiming and pre-pooled ball volleys

Unity 2021.3 LTSC#Object PoolingSingletonRigidbody2DLevel State Machine
Brick Breaker

A modern take on the arcade classic: aim the striker with the mouse, preview the shot arc, then launch a volley of balls that ricochets around the arena chipping away at multi-hit bricks. Clear every brick to unlock the next level layout.

Tech stack

Unity 2021.3 LTS · C# · 2D physics (Rigidbody2D bounce resolution) · uGUI (score, pause, level select) · WebGL build target

Architecture & design patterns

  • Pre-allocated object pools — Striker builds fixed arrays of 50 balls and 20 trajectory markers up front, then reuses them for every shot, so a volley of dozens of balls never triggers runtime Instantiate or GC pressure
  • Trajectory preview system — the same pooled marker objects are repositioned along the projected launch arc each frame, giving the player a live aim guide before committing to a shot
  • Level state machine — each Levels component owns a levelStatus (locked / unlocked / completed) plus its brick count, and a LevelManager drives selection, activation and completion across a Levels[] roster
  • Multi-hit brick model — Brick carries its own hit points and renders the remaining count as a live label, so difficulty is expressed as data on the prefab rather than branching logic
  • Singleton audio service with cross-scene persistence — SoundManager guards a static Instance, calls DontDestroyOnLoad, and resolves a SoundEvents enum against a serialized SoundType[] table, keeping call sites free of direct AudioClip references

Shooting staggers each ball by a short delay so a single input fires a readable stream rather than one indistinguishable burst, with bounce angles clamped to keep rebounds playable.

Gallery

Brick Breaker screenshot
Brick Breaker screenshot
Brick Breaker screenshot