Scratch game making tutorial 151

Portal escape

In this tutorial you will create a game in which the Cat is chased by bees. To avoid them, the Cat can enter a portal which teleport's it to a random place on the stage.

 

 

Complete these steps ..

 

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

 

 

2. Select the cat sprite, re-name it, and then click the "only face left-right" button ..

 

 

3. Add this script to the Cat so you can stop your game by pressing the "E" key on your keyboard ..

 

 

4. Now add this script to the Cat to set it's size and start position when the game begins ..

 

Press the B key and the Cat will re-size and move to its start position.

 

 

5. Next, you need to paint a portal sprite. Click the paint new sprite button under the stage ..

 

Select the circle tool, and red and click and drag to create an oval like this ..

 

When you are finished click OK and re-name it "Portal".

Now add this script ..

 

 

6. Use "File>Save as" to name and save your game. Name it "Portal escape" ..

 

 

7. Select the Cat sprite again. Let's add a script to do 2 things ..

  1. make the Cat follow the mouse pointer as the player moves it
  2. makes the Cat disappear when it touches the portal and re-appear somewhere else on the stage

Add this script ..

 

When you are done press the "B" key on your keyboard to test your game.

Press the "E" key to end your game, and then use "File>Save" to re-save it ..

 

 

8. Next, click the "Choose new sprite from file" button under the stage ..

 

Click to open the "Animals" folder and choose the bee ..

 

Rename the bee "Bee 1" and set it to only face left-right ..

 

Now add this script to Bee 1 to set it's size and start position when the game begins ..

 

We want the bee to chase the Cat, and return to where it started when it catches the Cat.

Add this script ..

 

Go full screen and then press the "B" key on your keyboard to test your game.

When you are ready exit full-screen, and then press the "E" key to end your game.

 

 

9. Use "File>Save" to re-save it your game ..

 

 

10. It would be great to have more than one bee.

Right-click "Bee 1" under the stage and choose "duplicate" ..

 

Re-name the duplicate "Bee 2" ..

 

You now have 2 bees ..

 

 

11. You need to change where "Bee 2" starts from, and returns to, after he stings the Cat.

Look at the image below and carefully change the "go to y:" scripts from 140 to -140 ..

 

Go full screen and then press the "B" key on your keyboard to test your game.

When you are ready exit full-screen, and then press the "E" key to end your game.

 

 

12. Use "File>Save" to re-save the game ..

 

 

13. Well done, you've finished making the game! Can you improve it with your own ideas? How about these ..