Book Image

Scratch 2.0 Game Development Hotshot

Book Image

Scratch 2.0 Game Development Hotshot

Overview of this book

Table of Contents (18 chapters)
Scratch 2.0 Game Development HOTSHOT
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a goal


Now that the cat can explore the maze, it needs a challenge. It's a good idea to give it a specific goal to search for.

Prepare for lift off

We will draw a sprite that will be the goal for the cat to reach. What this goal will look like is not really important. The important thing is that it is exactly 20 x 20 pixels in size, so it will fit a tile segment perfectly.

I choose to represent the goal as a "magical" warp panel consisting of bright, blue rings. You can create the same or design your own goal sprite.

Once done, name the sprite as exit. This will give us the following screenshot:

Engage thrusters

This sprite will have the same two broadcast listeners as the cat to start working. When the maze is drawn, we will hide the sprite, and when the game starts, we will show it by performing the following steps:

  1. Drag the when I receive <createMaze> script from the cat and drop it on the exit sprite to copy it there. That's the first half done.

  2. Then, start the second script with...