1. Remix the Maze Starter Project
Welcome to activity 3 of Scratch Games! Today, you will explore if statements while you create a maze game. If statements allow the computer to check a condition and decide whether to do something. If statements have two parts, an IF and a Then. They can be read, “if this is true, then do this.” The game Pacman is a good example of how “if” statements work. Pac-man is a classic arcade game from the 1980’s. In this game, a character must avoid a swarm of enemies.
The Pac-Man character uses if statements in many different ways. If pac-man is touching an enemy, then he loses a life. In Scratch, you can createthis kind of statement with a block stack. For example, you could code an if statement that tells the computer, "if touching enemy, then change lives by minus 1.”
Even the maze in Pac-man uses if statements! Pac-man can only move forward if he is not facing a wall. In this activity, you will create a game in which players use the mouse to guide a sprite through a maze. You’ll use if statements to complete this project. For example, if the sprite touches the walls of the maze, then it changes direction, or if the sprite touches the bug at the end of the maze, then the game ends. Check out the different starter projects, and decide which one fits the story your game will tell.
To begin, choose one of the starter project links next to this video.
Then, click "remix," and sign in to Scratch. Signing in will create and save a copy of the Maze Game Starter Project to your Scratch account.
Now it’s your turn: 1. Open and remix one of the starter projects.
2. Sign in.
Once you’ve finished these steps, come back to the CS First page, and click the green arrow to move on to the next video.