Executable ·· play.0001
Breakout
score 0 lives 3 level 1
←→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.