Scratch exercise 80

 

Portal gun

In this exercise, the Cat uses a "portal gun" to fire a portal that it can enter. When it enters the portal it disappears, and then reappears at a random location.

Complete these steps ..

 

1. Create a new game file.

2. Add these scripts to the stage ..

 

3. Paint a portal. Something like this ..

Name it "Portal".

 

4. Select the cat sprite and re-name it "Cat". Ensure the Cat can only face Left-Right and then add these scripts to it ..

 

5. Save your game using File>Save as. Call it "Portal gun".

 

6. Download, save and then use the "Choose new sprite from file" button under the stage to add this portal gun sprite to your game ..

Open it in the paint editor window and ensure it's center point is on the handle (where the cat will hold it).

Now add these scripts to it ..

 

7. Re-save your game using File>Save

 

8. Select the Portal sprite and add these scripts to it ..

 

8. You're done! Save your game again.

 

9. Press the "b" key to begin your game, and the "e" key to stop it. Use the arrow keys to move the Cat and click the mouse to fire a portal.