Day 5 Unit 3

Unit 3. Maze Game – If-then statements

Welcome back, we are continuing with the maze game. Before lunch, we made the sprites follow where your mouse pointer is going.

Now we will enforce the rule that the sprite has to stay within certain colors in your backdrop, allowing them to only follow certain paths, like a maze!

To learn how to do that, let’s watch this video.

https://csfirst.withgoogle.com/c/cs-first/en/game-design/maze-game/stay-inside-the-lines.html

Now that the rules of the game are built, we need to define the conditions to win. We will say that the user will win the game when the player sprite goes through the maze and catches the goal sprite without touching the boundaries.

The if, then statement you’ll create will read something like this: If touching the goal sprite, then say, “You win!”

Let’s watch this video to learn how to code the winning condition.

https://csfirst.withgoogle.com/c/cs-first/en/game-design/maze-game/using-if-statements-to-win.html

Great work! Because we were quite busy with two games today, we don’t have time to share and show our work. But you can continue working on the games during the weekend by adding extra to your games.

https://csfirst.withgoogle.com/c/cs-first/en/game-design/maze-game/add-ons.html

You can create obstacles in your maze path, keep track of the time that users take to finish till the goal post, and redesign your maze. Have fun on your games during the weekend. We will make sure to share and show the games that you built next week.

Don’t forget the reflection survey for today, and see you next week!