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 more levels


This recipe is all about adding additional levels to your game. We're still going to work with the maze we've been working with in other recipes, so open up the Scratch file where we left off previously.

Note that you do not have to have finished the recipe on keeping a high score list to complete this recipe. In fact, you can do this recipe without having finished anything else in this chapter! Just keep in mind that a few things may look different in our pictures, and you still need the Using the timer recipe of Chapter 4, Basic Gaming.

Getting ready

One of the first things to note when adding new levels is that there will be a few different places where we just have to add minor pieces of code.

The first thing you should do is think about what you want your maze to look like. Before we get going, make sure the stage is selected. Just as we did with making our first background, paint yourself a new background. Note that you'll want to use the same wall color to keep your...