Pong was one of the first video games. You can relive the olden days and make your own! In this tutorial, we will put together all the stuff we learned and learn more. This tutorial is long but you will feel good when you finish it. Here’s how!

Make the backdrop black, delete the cat and add in 2 white, fat lines (call them paddle 1 and paddle 2) and one white ball (create them in the paint editor),

Select the ball sprite,

Drag over your green flag,

Drag over the ‘point in direction’ block,

Join the ‘pick random 1 to 10’ block,

Change the 1 in the block to 0 and 10 to 360,

Bring over the ‘forever’ loop and put in the ‘move 10 steps’,

Change the 10 to 5,

Also drag over the ‘if on edge, bounce’ block into the loop,

Bring over another green flag block,

Drag over a ‘forever’ loop,

Put the ‘if <> then’ loop in the’forever’ loop,

Put the ‘touching mouse-pointer’ block into the loop,

Change the ‘mouse-pointer’ to ‘paddle 1’,

Drag in the ‘turn 180 degrees’ block,

Put the ‘move 10 steps’ block in,

Change the 10 to 5,

Duplicate the script but in the ‘touching paddle 1’ section change it to paddle 2,

Now go to the ‘paddle 1’ sprite,

Click the ‘i’ in the sprite’s icon,

Set the rotation style to the dot,

Drag over the ‘when key <space> pressed,

Change the <space> to <w>,

Drag the ‘point in direction 90’ block in,

Change the 90 to 0,

Drag the ‘move 10 steps’ block under that,

Duplicate the script,

Change the ‘w’ to ‘s’,

Change the direction to 180,

Make the same script for the ‘paddle 2’ sprite but change the ‘w’ to ‘up arrow’ and the ‘s’ to ‘down arrow’,

You’ve done it!

Note: new tutorials come every Friday or Saturday!

3 thoughts on “Pong game

Leave a Reply

Your email address will not be published. Required fields are marked *