Scratch exercise 25

Continuous walker

In this exercise, you will make the Cat walk. When the Cat reaches the edge of the stage, it will disappear and then reappear on the other side.

Complete these steps ..

 

1. Create a new game (From the top menu choose File>New).

 

 

2. Re-name sprite1 "Cat", then click the "only face left-right" button ..

 

 

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


 

4. Add the script to allow you to make the Cat walk left and right ..

 

 

Press the "B" key to begin your game and then use the left and right arrow keys to make the Cat walk.

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

 

 

5. The stage is 240 pixels from the middle to its left and right edges. It is therefore 480 pixels wide. This is called the x axis.

Add the final script to make the Cat jump to the opposite edge when it reaches the edge of the stage ..

 

Press the "B" key to begin your game and then use the left and right arrow keys to make the Cat walk to the edge of the stage.

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

 

 

6. Go to "File > Save as" and save your game in your folder. Name it "Cat walker" ..

 

Well done! You're finished. Can you turn this exercise into your own game?