A Simple Pong Game
image missing Simple Pong Game

Demostrate the use of:

  • Setting initial conditions before forever loop
  • Sprint movement followes mouse movement
  • Touching sprites and edges
  • Random numbers

image missing

Start scratch and delete the cat.

This creates an empty project.

Save the project under your name.

image missing Click on the 'new sprite' button.
image missing Select the Ellipse tool.

Make sure the 'solid' fill is selected below

image missing Draw a very small ellipse (holding down SHIFT) will make sure it's a perfect circle.

Click OK.

image missing With the sprite selected, rename it to "ball".
image missing Draw a small paddle using the rectangle tool, in a color of your choice.
image missing With the sprite selected, rename it to "paddle".
image missing 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".
image missing Select the "ball" sprite.
image missing 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…

image missing Select the "paddle" sprite.
image missing 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.