Making an Atari Breakout Game in Scratch

In this lesson, you will learn how to make the prototype of the famous Atari Breakout game on Scratch using stuff we've learned last week!

Try the actual game here: Atari Breakout

Code for the Ball:

  • Touching Edge

    • A block that detects collision between the ball and the board This block checks for whether the ball is touching the board! When the user moves the board over to touch the ball, the boing sound will play and the basketball will move back up. A random angle at which the ball bounces off makes the game much harder.
  • Speed

    • A block that causes the ball to move This block of code determines the speed the ball moves in with the “move ___ steps” command. This repeats forever (until stopped by the block of code that controls death), which means the ball continues moving at the same speed until you lose. The edge bounce mechanic is also put in here, meaning that the ball will bounce off the edges of the screen.
  • Game Over

    • A block that ends the game if you lose This block of code first places the ball at the coordinates (13,157) to start the game. Then, this code constantly detects for the lose condition, which is the ball touching the bottom red line. When this happens, all motion and code is stopped, and the game is over.

Code for the Paddle:

  • Moving

    • A block that allows the paddle to move This block tracks you mouse's position, and moves the paddle there. This way, you can control the motion of the paddle by dragging your mouse across the game screen. As you can see in the image, the "set x to mouse x block" is repeated forever (until the game finishes, of course), so you will be able to constantly move your mouse and the paddle will follow with little to no delay.

Youtube Tutorial

Final Product

Built by Fragaria Webdev