How to Make a Pong Game in Scratch | Tutorial

3 min read 10 hours ago
Published on Dec 13, 2025 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

In this tutorial, you will learn how to create a classic Pong game using Scratch. This step-by-step guide will walk you through the process of building a bouncing ball game featuring a paddle, scoring system, "Game Over" screen, and multiple levels. By the end of this tutorial, you'll have a fully functional Pong game to share and remix.

Step 1: Set Up Your Scratch Project

  1. Go to the Scratch website: Scratch Editor.
  2. Click on "Create" to start a new project.
  3. Delete the default cat sprite by right-clicking on it and selecting "delete".

Step 2: Create the Paddle

  1. Click on "Choose a Sprite" and select a rectangle shape for your paddle.
  2. Resize the paddle by clicking and dragging the corners.
  3. Position the paddle at the bottom of the stage.

Paddle Movement

  • In the code area, add the following blocks to control the paddle:
    • When the green flag is clicked:
      • Set the paddle's position to the center-bottom of the stage.
    • Use the "when [left arrow] key pressed" and "when [right arrow] key pressed" blocks to move the paddle left and right:
      if <key [left arrow] pressed?> then
          change x by -10
      end
      if <key [right arrow] pressed?> then
          change x by 10
      end
      

Step 3: Create the Ball

  1. Add a new sprite for the ball (you can use a circle shape).
  2. Resize and position the ball at the center of the stage.

Ball Movement

  • Add the following code to make the ball move and bounce:

    • When the green flag is clicked:
      • Set the ball's initial position and direction.
      go to x: (0) y: (0)
      point in direction (random [45 v] to [315 v])
      
  • Use a loop to continuously move the ball:

    forever
        move (10) steps
        if on edge, bounce
    end
    

Step 4: Scoring System

  1. Create a variable named "Score".
  2. Add the following code to increase the score when the ball hits the paddle:
    if <touching [Paddle v]?> then
        change [Score v] by (1)
        play sound [pop v]
        point in direction (pick random [45 v] to [315 v])
    end
    

Step 5: Game Over Conditions

  1. Create a new backdrop for the "Game Over" screen.

  2. Add code to check if the ball touches the bottom edge of the stage:

    if <touching [edge v]?> then
        broadcast [Game Over v]
    end
    
  3. On the "Game Over" backdrop, add code to switch to the game over screen when the message is received:

    when I receive [Game Over v]
        switch backdrop to [Game Over v]
    

Step 6: Multiple Levels

  1. Create additional backdrops for different levels.
  2. Use a variable (e.g., "Level") to track the player's progress.
  3. After a certain score, switch to the next level:
    if <(Score) >= (5)> then
        change [Level v] by (1)
        switch backdrop to [next level backdrop v]
        reset the ball and paddle positions
    end
    

Conclusion

Congratulations! You have successfully created a Pong game in Scratch. You can further enhance your project by adding sound effects, animations, or even more levels. Experiment with different designs and mechanics to make the game your own. Don't forget to share your game on Scratch and remix others' projects for inspiration!