

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Control the paddle using the mouse. 3 lives – if the ball touches the floor, you loose a life. It also shows the number of times the ball bounces.
RIGHT mouse click on the cat and select 'delete'
Click on the 'new sprite' button
Select the Ellipse tool
Make sure the 'solid' fill is selected below
Draw a very small ellipse (holding down SHIFT) will make sure it's a perfect circle.
Click OK.
With the sprite selected, rename it to ‘ball’
Now for the paddle… click ‘Paint new sprite’.
Draw a small paddle using the rectangle tool, in a colour of your choice.
Click and drag the paddle towards the bottom of the stage.
Rename the paddle sprite to ‘paddle’.
Click on the ‘ball’ sprite
Add the code as shown.
When the flag is clicked, the ball will ALWAYS shoot upwards in a random direction.
Those physicists amongst you will realise that we’re not using the proper laws of physics!
Press the green flag to test it so far…
Click on the paddle.
Add the script as shown.
The paddle will be controlled by the mouse.
Keeping track of the number of ‘lives’… Click on ‘Variables’.
A variable stores the value of something. We might have variables to store the number of ‘lives’, ‘score’ or someone’s name. Click ‘Make a variable’