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 – synchronizing and animating the horse


The first part of this exercise will be familiar to you. We want to animate the horse using its costumes. However, we'll combine that animation with another say block to create a fluid scene:

  1. Continue building the script by adding a next costume block.

  2. Add a wait () secs block.

  3. Add a next costume block. Note that since we are not actually going to call the name of the costume for the horse1 sprite, we're not going to take the time to rename them from their defaults.

  4. Add a say () block with an empty input value.

  5. Double-click on the script to run the code.

What just happened?

It was a tough crowd, and the joke fell flat, causing the horse to nervously rear up on its hind legs and say Hello, Is this thing on?. Even though our script technically runs the say (Hello, Is this thing on?) block before switching to the costume of the horse on its hind legs via the next costume block, any delay between the two actions is going to be difficult to notice...