Remix Library / Games

Brick Breaker

Bounce the ball, smash every brick. Aim with where it hits the paddle.

Intermediate HTML · CSS · JavaScript
No account needed: you’ll start as a guest.
read-only · remix to edit
Preview

What you'll learn

  • requestAnimationFrame
  • Collision detection
  • Velocity & angles
  • Mouse + keyboard input
  • Objects & arrays

Challenges

Remix it, then try these. Each one is a bit harder than the last.

  1. Give each row of bricks a different point value.
  2. Make some bricks take two hits (change color after the first).
  3. Add a power-up that drops from a brick and makes the paddle wider.
  4. Build level 2 with a different brick pattern once level 1 is cleared.
  5. Add a second ball that splits off when you hit a special brick.