This is a step to step guide, explaining how to make a pong game in Scratch. In this post, in the end, we will achieve a pong game. Before we begin, you will need an account in Scratch to create a pong game in scratch.. If you don’t have one then, head to how to create an account in scratch otherwise you won’t be able to create a pong game in scratch.
Choose a backdrop for your pong game.
Click the icon to open the Backdrop library:
Then choose the backdrop you want (such as neon tunnel or brick wall):
Click the icon to choose a new sprite:
Then select a ball for your game:
You can delete the cat with the scissors tool. Click on the scissors, then click on the cat:
Click the Motion category, and drag out a move block into the Scripts area.
Then, click on that block to make the ball move.
Want it to keep going? Snap-on the block if on edge, bounce.
Then, click the Control category. Wrap a forever block around the other blocks, like this:
Click anywhere on the stack of blocks to try it.
To stop, click the stop button:
Want it to go at an angle? Snap a point in direction block on top, and type in an angle.
Next, click the Events category.
Drag out a when clicked block and snap it on top:
Your script will start whenever you click the green flag:
Tip: Want to change the speed of the ball? Type in a different number of steps:
Add a paddle so you can start to play! Click to choose a new sprite:
Then, select a paddle from the Sprite library:
Tip: Adjust the size of the paddle by clicking with the grow or shrink tool:
Make it interactive! You can control the paddle with the mouse cursor.
Select the paddle.
Then build this script:
Click the green flag to start your scripts:
Click to choose the ball:
Add this script to make it bounce whenever it hits the paddle:
Here’s how to build the script:
Click the green flag to try it out:
Make a sound when the ball hits the paddle.
Click the Sounds tab, then click
Choose the ‘water drop’ sound (in Effects):
Then, click the Scripts tab. Click the Sound category, and drag out a play sound block.
Snap that sound block into the script, like this:
Make the game stop if the ball hits the bottom.
Click to select the Stage:
Select the Backdrops tab.
Now you can edit your backdrop. Select the line tool. Draw a thick line at the bottom:
Tip: Hold down the Shift key while drawing the line to make it straight.
Tip: To undo, click the Undo arrow:
Click to select the Ball sprite:
Click the Scripts tab, then add this script to make the ball stop if it hits the line color:
Tip: Click inside the square box in the touching colour block. Then move your cursor to point and click on the bottom line colour.
Change the colour of the ball when it hits the paddle.
You may want to set the ball’s starting position.
Move the ball to where you want it to start, then drag the go to x: y: block into the top of this script:
Create a variable for keeping score.
Then add the score blocks to your script:
You can also change what happens when the ball touches the bottom. For example: