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 – duplicating, flipping, and switching a sprite's costume


We've established throughout our exercises in this book that sprites have costumes, and we've chosen sprites that have more than one costume because it's been convenient to our projects. We can, however, add costumes to a sprite. In this exercise, we'll add a costume by duplicating an existing costume as follows:

  1. With the dog sprite selected, click on the Costumes tab.

  2. Right-click on the dog2-b costume and select duplicate to create a fourth costume called dog2-b2.

  3. Select the dog2-b2 costume and then click on the flip left-right button at the top of the image editor. The costume dog2-b2 now faces to the left.

  4. Name the costume face left. Also, change the name of dog2-a to face right. See the following screenshot:

  5. To use the new sprite, add the switch costume to () block to the top of the glide block. Select the face left costume.

  6. Add another switch costume to () block to the top of the script that starts with the set x to...