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 – animating a walking motion with the cat


We're going to build on our script by creating an appearance of movement:

  1. From the Looks palette, attach the switch to costume () block to the move () block in our script. The default costume will be costume2.

  2. Click on the green flag to move the cat. Note that the first time we clicked on the flag, the appearance of the cat changed, but it remained the same on subsequent movements.

  3. We'll make the animation more realistic in a minute, but let's examine the costumes by clicking on the Costumes tab. The following screenshot shows the contents of the Costumes tab:

  4. This view opens the sprite in the paint editor, but our primary interest is the costume thumbnails. If you've run the script as we've created, then costume2 is highlighted. Alternatively, click on the thumbnails and observe how selecting the costume displays on the stage.

  5. Depending on the speed of your clicks, the cat has the appearance of walking or running in place. There's no...