This week's goal

You make the character walk with the arrow keys and add a simple win or lose rule.

Challenge 1: four arrow keys

Draw blue maze walls, a green start and a gold star goal; place the cat at the start.
Step 1 — Draw blue maze walls, a green start and a gold star goal; place the cat at the start.

Create four scripts: when arrow key pressed and then replace change x/y. Children test each key and explain why left/right changes x and up/down changes y.

Challenge 2: maze wall

Connect when right arrow key pressed to change x by 10; test one key first.
Step 2 — Connect when right arrow key pressed to change x by 10; test one key first.

Draw a wall line with a clear color. In the test loop, use if it touches the color… then returns to the starting position. Let your child intentionally choose the wrong color and observe why the rule doesn't work.

Challenge 3: win condition

If the cat touches the blue wall color, send it back to the start.
Step 3 — If the cat touches the blue wall color, send it back to the start.
If the cat touches the gold goal color, make it say “You win!”.
Step 4 — If the cat touches the gold goal color, make it say “You win!”.
Run the maze: the cat reaches the star and the win message appears.
Step 5 — Run the maze: the cat reaches the star and the win message appears.

Set a star as destination. If you touch the star, say "I won!" and stop. Ask the child: "If you check the star first before checking the wall, will the game be different?"

Step-by-step lesson scenario

  1. Only do one arrow key first, then multiply the four directions.
  2. Draw a wall of a single color and choose the correct color in the color touch block.
  3. Add a destination and a win rule; Don't add a clock or multiple levels yet.
  4. Intentionally touch the wall to test if the rule really works.

Tip: only add one rule at a time. A maze with too many rules will make it difficult for children to know which part the mistake is.

Karotto: practice the conditions before making the game

Karotto puts the conditions into small challenges such as choosing a path or responding when encountering obstacles. Children learn to understand "if... then..." in a clear goal lesson, then carry that thinking to the Scratch maze.

See Karotto on the App Store →
Go to week 5: Variables and scores →