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:
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.
Then, start the second script with...