Student Subscription site screenshot Subscribe now

Subscribe to our Student Site to access all of our Games Coding Lessons for just £8 per month


Scratch game making lesson 033b

 

Random falling - intermediate

In this lesson you will make a game in which the Cat must dodge falling balls.

 

NOTE: You must use Scratch 3 or higher.

 

Complete these steps ..

 

1. Open Scratch, OR create a new game (from the top menu choose File>New).

 

 

2. Download, save, and then load/open this template game file into Scratch ..

Random falling intermediate v1.sb3

 

 

3. Select the Stage, create these 2 variables and then arrange them on the Stage ..

 

Now add this code to the Stage ..

 

Now add the code for a Timer which will record how long the player survives ..

 

 

5. Select the Ball sprite and click on it's Costumes tab ..

Notice how it has 5 costumes ..

 

Now add this code ..

 

Next, add the code to create clones of the Ball every 0 to 1.5 seconds ..

Notice how the Ball's costume changes after each clone is created.

 

Next add the code to make the Ball appear at the top of the Stage and then move down until it hits the bottom edge ..

Notice how the Ball sprite goes to a random location and then is moved near the top of the Stage (y:160) before it falls.

Press the B key on your keyboard to test your code.

When you are ready, press the E key to end your game and continue working on it.

 

 

6. Select the Cat sprite under the stage and add this code to set its properties when the game begins ..

Press the B key on your keyboard to test your code.

When you are ready, press the E key to end your game and continue working on it.

 

Now add this code to allow the player to move the Cat sprite right and left along the bottom of the Stage ..

Press the B key on your keyboard to test your code.

When you are ready, press the E key to end your game and continue working on it.

 

Next, add the code to make the Cat react when a Ball touches it ..

Press the B key on your keyboard to test your code.

When you are ready, press the E key to end your game and continue working on it.

 

Finally, add the code to take HP from the Cat sprite when a ball touches it ..

Press the B key on your keyboard to test your code.

When you are ready, press the E key to end your game and continue working on it.

 

 

7. Select the Game over sprite and add its code ..

 

 

8. Use the File menu to save your game. Name it Random falling v1.sb3 ..

 

 

9. Well done, you've finished this tutorial. Can you develop it and add your own ideas?