![]()
Simple Pong Game Demostrate the use of:
- Setting initial conditions before forever loop
- Sprint movement followes mouse movement
- Touching sprites and edges
- Random numbers
![]()
Start scratch and delete the cat.
This creates an empty project.
Save the project under your name.
![]()
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". ![]()
Draw a small paddle using the rectangle tool, in a color of your choice. ![]()
With the sprite selected, rename it to "paddle". ![]()
Draw a floor sprite using the rectangle tool, in a color of your choice. It must go from one side of the stage to the other.
Select the sprite and rename it "floor". ![]()
Select the "ball" sprite. ![]()
Add this code to the "ball" sprite. 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…
![]()
Select the "paddle" sprite. ![]()
Add this code to the "paddle" sprite. Change the stage background. Save it and try it out. Other things you might want to do
Add a sound when the ball hits the paddle.
Add another ball.