Christian M. Andersen · senior backend developer, Copenhagen archive · 2026 · 5 channels open

cma:~$ ./play/breakout

Executable ·· play.0001

Breakout

Breakout.exe ▸ running in page
score 0 lives 3 level 1

Breakout

Press Space or Start to run

←→ormousemove paddleSpacelaunchPpauseRreset

This one got away from me a bit. It started as a paddle and some bricks and ended up with four power-up types (expand, shrink, multi-ball, extra life), a particle system for brick destruction, and per-level brick layouts.

The interesting part was collision response. Naive Breakout bounces the ball off a brick by flipping one velocity component, which breaks as soon as the ball hits a corner or is moving fast enough to pass through a brick between frames. Working out which edge was actually crossed first, rather than which one the ball currently overlaps, is most of the difficulty.

‹ back to play