Project 210: Maze Game

9. Load the next level

Create code that loads the new level 2 backdrop when our main character touches the goal. Use what you learned from coding wall collisions as a hint!
Starting point file for this challenge

Your goal

Steps

1. Add another if-statement to your main character

We need to write the sentence "if the player touches the goal, then load the next level" in Scratch language. Grab an if-statement block. It's okay to add this right underneath the last if-statement block you made. 

2. Add a "touched color" condition

You want to check if your main character is touching the same color as the goal. This can be found in the light blue "sensing" blocks. 

3. Add a "go to start position" block

We want to send the player back to the start of the new maze. Grab the blue motion block "go to random position" and change it to say the name of your start sprite. 

4. Add a broadcast block with the message "Next Level"

The broadcast block lets you send a message from the main character sprite to a different sprite - or even to the backdrop. 

It can be found in the yellow "events" blocks. 

5. Add a "next level" block to your backdrop's code

This is found in the purple "looks" section. This is only available when you're coding on the backdrop.

6. Make the "next level" block only run if it receives the message "Next Level"

We usually wake code up with the "when green flag is clicked" block, but not this time. Let's instead only have the code run when the backdrop hears the message "next level." 

The "when I receive the message" block is inside the yellow "events" section.