Make a maze in Scratch - Part 2

About this lesson

Part 2 of the maze lesson

Step 1
Add a new sprite, this will be the enemy. Make sure to change the color of your sprite to a different color than the maze.

Step 2
Temp1422565149

Step 3
Shrink your bat and make it appear at the starting spot.
Step 4
Add movement to your sprite with the glide block.
Step 5
Duplicate your bat and add different movement to it. Do this as many times as you like.

Step 6
This is what mine looks like.
Step 7
This is the code for my bats.
Temp1406592562

Step 8
Add this block of code to the cat sprite. This is what will send the cat back to the start if a bat touches it.
Temp1408489986

Step 9
Add it in for however many bats you have.
Temp1406243759

Step 10
Create a new variable called "Lives". Add "change lives by -1" to the scripts we just created.
Step 11
Add this code to our existing scripts to make lives reset to 3.

Step 12
Create a new backdrop for when the player loses.
Step 13
Add this block of code to your cat sprite. This will bring up the "You Lose" backdrop if you run out of lives.
Temp1408490214

Step 14
Let's add a timer to give our player a limited amount of time to complete the maze. Create a new variable for time.
Temp1406244295

Step 15
Add this block of code to your cat sprite. This is what creates the timer for your game.
Temp1408490383

Step 16
Add this final block of code to your cat. This will bring up the "You Lose" backdrop when time runs out.
Temp1408490666

Step 17
Now play your game! Ask an instructor if you want to add anything else!

Try one of these lessons next:

Make a maze in Scratch - Part 2 Info

Account

MVCode Clubs

Created By

Missing tiny anmacdonald

Access Level

public

For Teachers and Schools

Teach coding to your students with MVCode Teach

MVCode offers an integrated product designed to teach coding to students.

Learn more about MVCode Teach