In this codelab, you'll make a maze game.

What you'll learn

Open the starter project and click Remix.

First, we are going to program the sprite to move when the arrow keys are pressed.

Steps

  1. When the up arrow is pressed...

  2. Make the superhero move up by changing the y-position. (The y-axis corresponds to "up" and "down".)
  3. Repeat this for the down direction (decrease y), and for moving right and left (change x)

Now we will check if the superhero is touching the wall and lose the game if she is

Steps

  1. Have the superhero check if she's touching the black wall, and say "game over" if she is
  2. If the game ends, the superhero should also return to the starting position (-190, -115) so the game can restart.

  3. This check should happen over and over while you're playing the game (remember the forever loop!)

  4. She should start checking if she's touching the wall when the game begins (remember Hat blocks!)

Now we will check if the superhero is touching the wall and win the game if she is

She can check if she's touching the Laptop in a similar way to how she checked if she was touching a black wall.

The Laptop is a sprite, not a color, so be sure to use the right block!

Once you have a working maze game, choose one or more additional features to add!
  1. Draw your own maze background! You can do this by changing the backdrop. If you want to make the superhero smaller, you can do that with a block in the Looks category
  2. Change the sprites for the player, home and goal of the maze
  3. Make something exciting happen when the game is lost or won
  4. Look at other scratch users' mazes here for more inspiration, or think of your own additons!
When you're finished, be sure to save and share your project, and then add it to the studio:
  1. Giga studio .
  2. Nano studio .