The arcade classic, with sparks, screen shake and an autopilot.
A complete small game: a paddle, a ball with angle-dependent bounces, bricks with hit points, lives and levels. Collisions use swept circle versus rectangle tests so the ball never tunnels through a brick. Broken bricks burst into particles, big hits shake the screen, and the occasional capsule turns one ball into three. Until you take over, a simple AI plays.
Try it. Move the pointer, or click the game and use the arrow keys, to control the paddle.
Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.
Build a Breakout game with JavaScript and the HTML canvas element. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.
Start simple:
- Make a canvas that fills the window, stays sharp on high-DPI screens (scale by devicePixelRatio), and resizes with the window. Use a dark background.
- Add a paddle near the bottom that follows the mouse (and the left and right arrow keys), a ball, and a grid of about 10 by 5 bricks across the top.
- Move the ball by velocity times delta time and bounce it off the side and top walls.
- When the ball hits the paddle, set its new angle from where it landed: dead center goes straight up, the edges send it off at about 60 degrees. Keep the speed constant.
- For brick collisions, grow each brick by the ball's radius and find where the ball's movement this frame first enters it (a swept test, the "slab method"), then bounce off that side. Use a few sub-steps per frame so a fast ball never tunnels through.
- Draw the score and 3 lives on the canvas. Clearing all bricks starts the next level.
Once that works, make it beautiful and juicy:
- Give bricks 1 to 3 hit points with a color for each, and show cracks when they are damaged.
- When a brick breaks, burst it into a dozen small particles with gravity, and add a short screen shake by offsetting the whole scene for a few frames.
- Add a simple AI that predicts where the ball will land, so the game plays itself until I move the mouse.
Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as power-ups like multiball, sound effects with the Web Audio API, or a level editor.