Sort of Ping Pong Game

This guide has been design to help you create a simple game. Follow these step-by-step instructions to create an interesting set of effects.

Use the paddle to keep the ball from hitting the ground.

Stage 1 - Making the paddle

Start a new Scratch project - "File" and then "New"

Delete the cat sprite; right click and select "Delete".

Add a new sprite by clicking on "Paint new sprite".

Use the "paint" facility to make a small ball

Use the "elipse" tool to draw a circle. Make sure that you use the filled elipse and if you hold "shift" while you draw it will be a circle not an elipse (although a circle is a special elipse mathematically speaking).

Press "OK" to save the sprite.

The sprite is called "sprite1" and sw need a better name than this.

Rename the sprite by typing over the name "Sprite1" with the name "ball".

To make the bat create a new sprite by clicking on "Paint new sprite".

Use the line tool to draw a short line parallel to the bottom of the screen.

Rename the sprite as "paddle"

Now give the ball this script.

Give the paddle this script.

See if you can make the ball bounce on the paddle.

Keeping score

You will need a variable to store the number of lives that you use up (if you miss the ball!)

Make a variable called "Lives".

Lives should be visible on the screen.

Add this script to the stage.

Now create a floor for the ball to land on if you miss.

Create a new sprite and draw a straight line the width of the screen.

This is the line, it will appear inthe middle of the screen.

Add this script to the floor to make it move to the right place by itself.

Now change the script for the ball to include the floor.

Note that when the ball hits the floor it will start at the centre of the screen again.

 

Recent Posts

July 24

Repairing a hyperspace window

Phasellus quam turpis, feugiat sit amet ornare in, hendrerit in lectus semper mod quisturpis nisi consequat etiam lorem. Phasellus quam turpis, feugiat et sit amet ornare in, hendrerit in lectus semper mod quis eget mi dolore.

July 18

Adventuring with a knee injury

Phasellus quam turpis, feugiat sit amet ornare in, hendrerit in lectus semper mod quisturpis nisi consequat etiam lorem. Phasellus quam turpis, feugiat et sit amet ornare in, hendrerit in lectus semper mod quis eget mi dolore.

July 14

Preparing for Y2K38

Phasellus quam turpis, feugiat sit amet ornare in, hendrerit in lectus semper mod quisturpis nisi consequat etiam lorem. Phasellus quam turpis, feugiat et sit amet ornare in, hendrerit in lectus semper mod quis eget mi dolore.

Spotlight

Neural Implants

The pros and cons. Mostly cons.

Phasellus quam turpis, feugiat sit amet ornare in, hendrerit in lectus semper mod quisturpis nisi consequat ornare in, hendrerit in lectus semper mod quis eget mi quat etiam lorem. Phasellus quam turpis, feugiat sed et lorem ipsum dolor consequat dolor feugiat sed et tempus consequat etiam.

Lorem ipsum dolor quam turpis, feugiat sit amet ornare in, hendrerit in lectus semper mod quisturpis nisi consequat etiam lorem sed amet quam turpis.