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

Playing sounds


The most basic thing we can do with sounds in Scratch is simply playing a sound. Scratch makes it nice and easy to incorporate a variety of types of sounds into any program we create. This first recipe will involve making our default sprite make a meow sound when it is clicked on.

Getting ready

To begin, create a new Scratch file. We'll be using the default cat sprite, but you can change it if you'd like. While you can add sounds into any of the previous programs we've created, we're going to keep it simple by making the sound the entire focus of this program.

How to do it...

Let's get started with the following steps:

  1. From the Events blocks, drag over the block.

    Note

    If you change the name to the sprite, the block we just added will reflect that name change. As we've mentioned before, for more complicated programs, you'll want to make your sprite names more meaningful than the default names. This helps keep things organized.

  2. Head over to the Sound category of blocks and drag over...