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 – hiding all sprites when the flag is clicked


We're going to animate our card, which means we're going to be changing the default appearances of the sprites in our card. Therefore, we need to think about the starting values of our sprites. As the first step in our animation, we'll hide all sprites so that we start with a blank screen. Then, we can introduce and animate each sprite in turn as shown in the following steps:

  1. Select the Happy Birthday sprite to display its script area.

  2. We'll use the click on the green flag as an event to trigger our script. From the Events palette, drag the when flag clicked block to the scripts area.

  3. From the Looks palette, snap the hide block to when flag clicked.

  4. Hide each of the letters that spell mom using the same script. Try the following shortcut:

    1. Right-click on the Happy Birthday script and select duplicate. The script attaches to your mouse cursor.

    2. Drag the script to one of the other sprites in the sprite list and click on it. The script copies...