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

Adding a pre-made sprite


This is one of the easiest ways to get programming quickly! The second of our buttons is called the Choose new Sprite from File button. This will open up a dialog box showing you all of the available sprites in the Scratch library.

You have many different sprites to choose from, including the categories of animals, fantasy, letters, people, things, and transportation.

Note

Remember, sprites are any objects you will be programming to do something in your overall program. In many cases, they will be characters in a story or in a game. In some cases, they may be buttons your user will interact with or some other general object. This is where the categories of letters or things come into play!

Getting ready

For the purposes of our first program, we'll choose one of the animals. You can choose whichever sprite you want, what matters is the programming we'll put into it later on.

How to do it…

Follow these steps and you'll have a new sprite to program within no time:

  1. Click on the first button from the set of four shown in the following screenshot:

  2. A dialogue box will pop up to select the sprite. Choose the folder for the type of sprite you want. Either double-click on the folder or click on OK.

  3. Find the sprite you like and then click on OK.

  4. The sprite will now be on the stage and ready to program with.

There's more…

The third button in the set we mentioned before allows us to upload a sprite from our computer. If you've created a picture of something on your own, you can use this tool to upload it. The last button allows us to take a picture using a webcam and then upload that as a sprite!

See also

  • The Starting up Scratch recipe in this chapter

  • The Changing the stage background recipe in this chapter