This is a step-by-step guide for making a paddle ball game in Scratch. You can either complete the challenges (advanced users), attempt the challenges using hints (intermediate users), or use the video tutorials (beginners).
You will need the Scratch software for this workshop. This is available free either in browser or as a desktop application. For the software and related information, go to scratch.mit.edu
If you are new to Scratch, we'd advise you to have a look at the basic space game workshop first.
Load up a new Scratch file and delete the default cat sprite to give you a completely empty project before starting on the challenges.
The first section of challenges aim to help you recreate the basic game structure as shown below.
Select speed and press spacebar to start demo
Make a ball sprite that, when spacebar is pressed, starts bouncing up and down the screen continuously.
Produce a paddle that travels left and right, following the mouse, near the bottom of the screen
Script block for movement
Script block to stop rotation
Program the ball to 'bounce' off the paddle
You will need to add the below code blocks to the ball script
The game requires bricks that disappear when hit by the ball
You will need to put the below code blocks together to form a script for a brick
Introduce a score system that goes up each time a brick is 'destroyed'. Use this to also determine end of game once all blocks destroyed.
You will need to find the right places to include the below coding blocks
We need a variable slider to set the ball speed for the game.
You will need to use the below blocks to complete this challenge.
The player should have 3 lives. These need to be illustrated in the bottom left corner and one lost everytime the ball hits the bottom of the screen. Game should stop when all lives are lost.
You will need to find suitable homes with scripts for the below blocks:
Having completed the basic scripts for an operational paddle-ball game, it is now time to add some finishing touches and personalise it.
Here is a list of things you may wish to consider doing:
Make the ball bounce more realistically off the paddle and bricks.
In challenge 3 we made the ball 'bounce' of the paddle, the easiest way to do this was to change the direction by a set amount. This did not recreate a realistic bounce such as that seen when the ball hit the edges. So how can we correct this?
To do this we will need to replace the 'turn' motion with a 'point in direction' block. Then using an operator block set the direction to 180 - 'direction'.
The problem now is that the bounce will be realistic, but the ball will get stuck easily on a set route. To correct for this we need to change the block so it reads:
Point in direction 180 - direction + pick random -10 to 10
Ping-Pong
Now that you have completed this workshop to create a paddle ball game, you should be able to take what you have learnt and use it to create your own version of 'Pong'.