Book Image

Scratch 2.0 Beginner's Guide: Second Edition

By : Michael Badger
Book Image

Scratch 2.0 Beginner's Guide: Second Edition

By: Michael Badger

Overview of this book

Table of Contents (18 chapters)
Scratch 2.0 Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – adding a second sprite and script


We've mentioned that we can have multiple sprites acting out their scripts, but now we're going to add a second sprite to the project to illustrate the concept and explore some additional motion blocks and loops.

  1. Add a new sprite by clicking on the Choose new sprite from library option. Then, browse to the Animals category and select Dog1. Click on OK to add the dog to the project.

  2. Ensure Dog1 is selected in the sprite list to ensure we have the scripts area for the dog.

  3. From the Motion palette, drag one of the turn blocks into the scripts area.

    Tip

    Two turn blocks

    If you look in the Motion palette, you'll notice that there are two turn blocks. One has a circle arrow that points clockwise and the other turn block points counter-clockwise.

  4. Find the repeat block from the Control palette and snap it around the turn block.

  5. Wrap the script in the forever block.

  6. From the Events palette, add the when this sprite clicked block on top of the entire stack...