Scratch game making tutorial 116

Hi-rise cat

In this tutorial you will create a platform game in which the Cat must avoid enemies and collect health to survive for 2 minutes.

 

Complete these steps ..

 

1. Create a new game and then right-click the cat thumbnail ("sprite1") to delete the cat sprite.

 

 

2. Select the stage, switch to the "Backgrounds" tab and then import this background image ..

This background has black horizontal lines with gaps that the sprites can pass through as they climb or fall.

Now delete the blank white background.

Later you may wish to paint your own background.

 

 

3. Create these variables ("for all sprites") ..

 

The Cat lives variable will hold the Cat's health and the Timer will countdown 120 seconds (2 minutes).

Move these variables into the top corners of the stage ..

 

 

4. Add these scripts to the stage ..

Note that the Timer is set to 2 minutes (120 seconds).

 

 

5. Use "File>Save as" to save your game. Name it "Hi-rise cat".

 

 

6. We need to import a specially edited Cat sprite. Download and save this sprite ..

Now use the "Choose new sprite from file" button under the stage to load it ..

 

 

7. Select the Costumes tab to have a closer look at the cats costumes. You will see that the Cat has a purple hat on ..

We will use this hat to stop the cat from passing through a black line when it jumps.

Click the button to make sure the Cat can only face left-right ..

.

 

 

8. Switch to the Cat's script tab and add these scripts to the Cat ..

 

 

9. Now add the scripts to make the cat walk left and right and jump up ..

 

Press the "B" key to test your scripts. Try out the left, right and up arrow keys. Press "E" to end when you are done.

 

 

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

 

 

11. Add the next script to the cat. This makes the cat fall unless it's touching (standing on) a black line ..

 

 

12. Now add the final Cat script which controls it's health ..

 

 

13. Next we need to load a Health sprite which will appear randomly. When the Cat touches it it's health will increase.

Download and save this sprite ..

Now use the "Choose new sprite from file" button under the stage to load it ..

 

 

14. Add these scripts to the Health 1 sprite ..

Press the "B" key to test your game. Move the Cat to touch the health when it appears. Does your health score go up? Press "E" to end when you are done.

 

 

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

 

 

16. If you are sure your health scripts are correct and working well, duplicate the health sprite. Re-name the duplicate "Health 2".

Now select the Cat sprite scripts and edit the health script so that the Cat's health increases when it touches "Health 1" OR "Health 2" ..

Press the "B" key to test your game. Press "E" to end when you are done.

 

 

17. Next we need to load an Enemy sprite which will appear randomly. When the Cat touches it will lose some health.

Download and save this sprite ..

Now use the "Choose new sprite from file" button under the stage to load it ..

 

 

18. The Enemy sprite is going to move left, right and upwards, finding it's own path through the black lines. It will also take health from the Cat.

Add these scripts to the Enemy sprite ..

Press the "B" key to test your game. Press "E" to end when you are done.

 

 

19. If you are sure that the enemy scripts are working OK, duplicate it the sprite 3 times.

 

 

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

 

 

21. Well done. You've finished. What new ideas can you add to this game?