Book Image

Scratch Cookbook

By : Brandon Milonovich
Book Image

Scratch Cookbook

By: Brandon Milonovich

Overview of this book

Scratch 2.0 is an easy to use programming language that allows you to animate stories and create interactive games. Scratch also gives you the capability of using programming to calculate complicated calculations for you. Scratch Cookbook will lead you through easy-to-follow recipes that give you everything you need to become a more advanced programmer. Scratch Cookbook will take you through the essential features of Scratch. You'll then work through simple recipes to gain an understanding of the more advanced features of Scratch. You will learn how to create animations using Scratch. Sensory board integration (getting input from the outside environment) will also be covered, along with using Scratch to solve complicated and tedious calculations for you. You'll also learn how to work through the exciting process of project remixing where you build on the work of others. Scratch Cookbook will give you everything you need to get started with building your own programs in Scratch that involve sounds, animations, and user interaction.
Table of Contents (17 chapters)
Scratch Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adjusting the timing


There is a good chance that the story you have in mind includes more than one sprite. This means that you are also going to need to think about timing in your story since you don't want to have both sprites talking at the same time.

Tip

Timing can become more and more complex depending on the program, especially as you add more and more sprites and length to your story. A good way to handle this situation is to think ahead of time as to when you want your sprite to speak, and when you want them to simply observe. Having this planned out will help you program much more quickly.

Getting ready

Continuing with our existing story, add another sprite. For example, we added a frog to our program in the bottom center. Copy over the same code (that we used for the first sprite) to make the second sprite think and talk. Note that if you duplicated the sprite, this is done for you. You'll notice both of them talking at the same time, which is what we are going to learn to fix (see...