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 character


To make use of our generated maze, we will need to include a character the player can control. We'll use the default Scratch cat as the protagonist and add all the required control script to make it move through the maze.

Prepare for lift off

If we haven't left it on the stage from the start, we have to add the Scratch cat as a new sprite as shown in the following steps:

  1. Click on the Choose sprite from the library icon.

  2. Search for the Scratch cat option, select it, and click on OK.

The Scratch cat will be loaded for use in the game. Next, we will add a script to it to make it interactively controlled by the player.

Engage thrusters

Let's first set up the broadcasts that will trigger the cat sprite to take proper actions. We need two of those events. The first one is very simple and will be repeated in all game objects as follows:

  1. Start a new script with when I receive <createMaze>.

  2. To this, add the hide block to hide the sprite as shown in the following screenshot:

    This...