Raspberry_Pi_Education_Manual

Notes:

Over to you

Task: Now add some code to your other character to move it to the right of the stage and then after a short delay move it into the centre stage.

Well done! You have certainly got the hang of moving sprites about the screen. Why not add some more characters to your stage and get them to tell jokes? If you are having problems, you can load the sample code, “ roman_play.sb ”, to see how the program is put together. Feel free to change things and to experiment, as this is a great way to learn.

Lesson 1.3: Animation (loops)

Learning objective: In this exercise, you will learn how to use repeat loops to create simple animations. Resources: The sprites “ bee ”, “ female_flower ” and “ male_flower ”, and the background “ flower_bed ”. With its animated characters, Scratch is great for telling stories. I have to do a school science project on pollination, so I have decided to use Scratch to tell the story of pollination in moving pictures. You can help me by following these instructions to animate a bee in flight. First, open the file “ bee1 ” from the “ Animals ” folder in the Scratch gallery. Next, import the background “ flower_bed ”, this time from the “ Nature ” folder in the Scratch gallery. Delete the cat sprite; we don’t need it for this project. Copy “ bee1 ”, then edit “ bee2 ” using the Select and Flip Horizontally tools, to make its wings point downwards. Together, the two costumes – “ bee1 ” and “ bee2 ” – will become an animation of a flying bee.

Copy your bee, then edit “bee2” so that its wings point downwards.

A beginner’s guide to Scratch

18

Made with FlippingBook flipbook maker