Introduction: Why Build a Fun “Bouncing Ball” Pong‑Style Game in Scratch
Are you curious how to build games in Scratch or just starting your journey into block programming? Scratch is a block‑based, drag‑and‑drop programming environment created by MIT. It’s a fantastic platform for beginners—especially kids—to learn programming concepts using visually intuitive code.
This bouncing‑ball game combines fundamental elements:
- Motion & coordinate control
- Sensing sprite overlaps
- Variables for scoring
- Control loops & if‑statements
- Environments: changing backdrops with game progression
And guess what? In under 90 minutes, kids or novices can make a fun game in Scratch that bounces, scores, changes themes, and has game-over behavior—all without typing a single line of code.
What You’ll Learn in This Tutorial:
- How to make a game in Scratch with motion, collision, and scoring
- Control sprite behavior using events and loops
- Use variables to track scores
- Change backdrops to enhance the gaming experience
- Stop the game on a “game over” condition
- Bonus: enhancements to make your game more advanced!
“Bouncing Ball” Pong‑Style Game: Step-by-Step Guide
Before jumping into code, here’s what the final Scratch game includes:
- A bouncing ball sprite that moves and reflects off edges.
- A green paddle sprite you control with the mouse—horizontal movement only.
- A red “game-over” line at the bottom; touching it stops the game.
- A scoreboard that increments every time the ball hits the paddle.
- Backdrop switching when the score reaches five to make the environment pop.
This touches on key Scratch concepts: sprite selection, backdrop management, variables, senses, control, and motion. Plus it includes some afresh theme swapping—perfect for a Splashy first Scratch project.
A. Set Up Your Sprites & Backdrops
- Delete default cat sprite → pick the ball sprite.
- Add two backdrops: Boardwalk and Concert. Optional extras can be removed.
- Add a sprite for the “line” → type “line” in Scratch’s sprite search → choose a red horizontal line and position it at the bottom.
- Add the “paddle” sprite → search “paddle”, pick the green paddle, position near bottom, above the red line.
📝 Note: Backdrops set the game’s scenes. Changing them when milestones are reached makes the experience dynamic.
B. Block Programming for the Ball
1. Start Ball Motion on Green Flag
when [green flag] clicked
point in direction (45)
forever
move (10) steps
if on edge, bounce
This block initiates the ball movement at a 45° angle and keeps it bouncing between edges. Great for ball bounce in Scratch.
2. Bounce Off the Paddle, Increment Score
if < touching [paddle] ?> then
change [score v] by (1)
turn cw (pick random (170) to (190)) degrees
move (15) steps
wait (0.5) seconds
end
This custom logic boosts score by one each time the ball hits the paddle, adds a random reflection (avoiding repeated touches), and slightly delays before continuing. Essential for the Scratch bouncing ball game feel.
C. Set Score Variable & Reset
Initialize score at game start:
when [green flag] clicked
set [score v] to (0)
Combine this with ball motion blocks to ensure every playthrough starts fresh.
D. Backdrop Change at Score ≥ 5
when [green flag] clicked
wait until < (score) > (5) >
switch backdrop to [Concert v]
Your game switches scenes automatically once you hit five! A fun way to show progression in your Scratch game development.
E. Game Over: Red Line Collision
when [green flag] clicked
forever
if < touching [line] ?> then
stop [all v]
end
end
Touching the red line triggers a full stop. This simple check completes your game loop and ties into Scratch game tutorial essentials.
F. Paddle Follows Mouse
when [green flag] clicked
forever
set x to (mouse x)
end
This ensures the paddle follows your horizontal mouse movement—classic Pong in Scratch control. Confining vertical motion keeps gameplay fair.
Final Code Blueprint – All in One
Full Ball Script
Here’s the complete set of ball scripts assembled:
when [green flag] clicked
set [score v] to (0)
point in direction (45)
forever
move (10) steps
if on edge, bounce
if < touching [paddle] ?> then
change [score v] by (1)
turn cw (pick random (170) to (190)) degrees
move (15) steps
wait (0.5) seconds
end
end
Then add a separate sprite script for backdrop switch and red line collision.
Red Line Sprite
when [green flag] clicked
forever
if < touching [ball] ?> then
stop [all v]
end
end
Backdrop Control (can be in stage scripts)
when [green flag] clicked
wait until < (score) > (5) >
switch backdrop to [Concert v]
Full Paddle Script
Simple & elegant:
when [green flag] clicked
forever
set x to (mouse x)
end
That’s it. Paddle built with drag and drop programming—no complex code needed.
Scratch Game Enhancements – Take It to the Next Level!
Once you’ve built the basic version of the game, here are some powerful enhancements you can add to make your game more interactive, challenging, and fun:
🔁 1. Add Multiple Levels
You can create different backdrops for each level, and increase the difficulty gradually.
How:
- Add more backdrop scenes like “City”, “Jungle”, or “Underwater”.
- When score reaches 5, switch to level 2.
- When score reaches 10, switch to level 3, and so on.
wait until <(score) > [10]>
switch backdrop to [Next Level v]
change [ball speed] by (2)
⏩ 2. Increase Ball Speed Over Time
To make the game progressively harder, increase the ball’s speed after every few points.
How:
- Introduce a variable:
ball speed
- Update the ball movement block:
move (ball speed) steps
- Every few points, increase speed:
if <(score) mod 5 = 0> then
change [ball speed v] by (2)
end
❤️ 3. Add Lives or Health Points
Instead of ending the game immediately when the ball hits the red line, you can give the player 3 chances (lives).
How:
- Create a variable called
lives
and set it to 3. - When the ball touches the red line:
change [lives v] by (-1)
wait (1) seconds
go to x: (0) y: (100)
point in direction (pick random (45) to (135))
- If
lives = 0
, then stop all.
🔊 4. Add Sound Effects and Music
🎧 Scratch has a built-in sound library. Add a bounce, paddle hit, or game over sound to make it lively.
if < touching [paddle] ?> then
play sound [pop v]
You can also add background music with looping:
when green flag clicked
forever
play sound [game-music v] until done
end
🌟 5. Add Visual Effects and Particle Sprites
Use “change color effect”, glow trails, or emit particles when the ball hits the paddle. It adds polish and visual feedback.
change color effect by (25)
set ghost effect to (30)
Also, add a particle sprite and clone it on every paddle hit.
📊 6. Show a “Game Over” Screen
Create a separate sprite called “Game Over” text that only shows when lives = 0.
when green flag clicked
hide
when [lives v] = (0)
show
This improves the user experience and brings closure to the game.
🧠 7. Use Custom Blocks for Clean Code
Use My Blocks to create modular code, like bounceOffPaddle
, checkGameOver
, or updateLevel
. This improves organization and teaches coding abstraction.
Why These Enhancements Matter
Implementing these upgrades lets you practice deeper Scratch programming skills like:
- Nested conditionals
- Cloning
- Custom variables
- Modular design
- Difficulty balancing
- Event triggers and game states
If you’re using Scratch coding classes or teaching coding games for kids, these enhancements offer amazing opportunities to go beyond basics while reinforcing foundational concepts.
Summary of Key Skills Practiced:
Concept | Applied In |
---|---|
Motion | Ball movement and bounce |
Sensing | Paddle and line collisions |
Variables | Score and lives |
Conditionals | Touch checks, level change logic |
Loops | Forever motion and checking conditions |
Events | Starting and stopping with green flag |
Backdrops | Scene transitions |
Final Thoughts
Congratulations! You now have the full Scratch bouncing ball game built in Scratch:
- Learn important programming concepts—motion, sensing, variables, control
- Create a Pong‑style interactive playing field
- Add visual interest (backdrop switch)
- Stop condition built in
- Editable & remixable for future creativity
👉 Watch now on YouTube – Follow along step-by-step and pause as needed.
This Scratch bouncing ball game is just the beginning. From here, you can build:
- A full arcade-style game
- Multiplayer pong (2 paddles)
- A breakout-style game with blocks to destroy
- Or evolve this into a mobile game prototype
If this tutorial helped, please:
- Don’t forget to check out the full video tutorial by Kodex Academy here: Watch the full – Pong Game with Bouncing Ball – Scratch Game by Kodex Academy
- Like, comment & share the video
- Visit kodexacademy.com
- subscribe to the Kodex Academy YouTube channel for deeper Scratch content.
Happy coding with Kodex Academy!