Use Scratch to code a bouncing ball game, make the ball bounce, add controls and scoring, and learn basic programming concepts.



Step-by-step guide to code a bouncing ball game
Step 1
Open the Scratch website or app and click Create to start a new blank project.
Step 2
Delete the default cat sprite by selecting it and clicking the trash icon.
Step 3
Add a Ball sprite from the sprite library or draw a round sprite and place it near the top center of the stage.
Step 4
Add a Paddle sprite by painting a rectangle or choosing one and move it to the bottom center of the stage.
Step 5
Create three variables named xVelocity yVelocity and score for all sprites.
Step 6
On the Ball add a "when green flag clicked" script that goes to x:0 y:100 sets xVelocity to pick random -4 to 4 sets yVelocity to 8 and sets score to 0.
Step 7
On the Ball add a forever loop that changes x by xVelocity changes y by yVelocity and changes yVelocity by -0.5 each loop to simulate gravity.
Step 8
Inside that Ball loop add an "if touching Paddle" block that sets yVelocity to 8 changes xVelocity by pick random -1 to 1 and changes score by 1.
Step 9
Inside the Ball loop add an "if y position < -170" block that uses the "stop all" block to end the game when the ball falls below the stage.
Step 10
On the Paddle add a "when green flag clicked" forever script that if key right arrow pressed change x by 10 and if key left arrow pressed change x by -10 so you can move the paddle.
Step 11
Click the green flag to play and tweak numbers like xVelocity yVelocity or the gravity value until the ball bounces and feels fun.
Step 12
Share your finished bouncing ball game on DIY.org
Final steps
You're almost there! Complete all the steps, bring your creation to life, post it, and conquer the challenge!


Help!?
What can I use if I can't access the Scratch website or can't find the Ball or Paddle sprites?
Use the Scratch Offline Editor or ScratchJr on a tablet, or open the costume editor and paint your own Ball and Paddle sprites and name them exactly Ball and Paddle so the scripts like 'if touching Paddle' work.
Why does the ball sometimes pass through the paddle or not bounce?
Check that you made xVelocity and yVelocity variables for all sprites, that the 'if touching Paddle' block is placed inside the Ball's forever loop, and that the Paddle is positioned near the bottom of the stage so collisions register.
How can I adapt this activity for different age groups?
For younger kids use a larger Paddle costume, slower speeds (set yVelocity to 6 and change x by 5) and guided step-by-step help, while older kids can increase gravity or xVelocity ranges, add multiple balls, or create level challenges using the score variable.
How can I personalize or extend the bouncing ball game?
Add sounds to the Ball's 'if touching Paddle' block, create a lives variable and change the 'if y position < -170' block to subtract a life instead of 'stop all', increase difficulty when score reaches thresholds, and customize backgrounds and Ball costumes before sharing on DIY.org.
Watch videos on how to code a bouncing ball game
Facts about Scratch programming
💥 Collision detection — checking when two sprites touch — is the trick that makes balls bounce and players score.
🧩 In Scratch, game objects are called "sprites" and each sprite can have its own scripts, costumes, and sounds.
🔁 Many beginner bouncing-ball games simply reverse the ball's velocity on impact instead of simulating full physics to keep the code simple and fun.
🎮 Pong was released in 1972 and helped popularize simple two-dimensional bouncing-ball gameplay.
🐱 Scratch's mascot is a cat, and Scratch uses colorful drag-and-drop blocks to teach coding to millions of kids.


Only $6.99 after trial. No credit card required