Programming wizard palace
7 Minutes · Module 8 - Wizard Palace
Scratch Junior maze game programming for kids: learn to code arrow controls, maze collisions, and page transitions. A Tamil coding lesson.
- Using message blocks to move Tom with directional arrows
- Making Tom reset with go home block when touching maze lines
- Switching to the next page when Tom touches the flower
What this lesson teachesRead the lesson as text
A Scratch Junior maze game is programmed by combining touch triggers, color-coded message blocks for navigation, collision blocks that reset player movement, and page transition blocks that load new levels. These elements work together to control a character through obstacles toward a goal.
How directional controls work
Direction buttons control a character through paired message blocks. When a player taps an arrow character on the screen, a touch trigger block activates a send message block. The main character, Tom, uses a receive message block set to the exact same color. Once Tom receives that colored message, an attached motion block moves him in the matching direction.
Coding the four directions
- The green arrow uses a touch trigger to send a green message, which instructs Tom to move right using a motion block.
- The red arrow uses a touch trigger to send a red message, which tells Tom to move left.
- The orange down arrow sends an orange message on touch, which prompts Tom to move downward.
- The purple up arrow sends a purple message on touch, which directs Tom to move upward.
Resetting on maze collisions
If Tom runs into any of the maze lines, he must be knocked out and sent back to start over. To create this obstacle, a touch trigger block is placed in Tom's programming area to detect contact with the maze walls. This trigger connects directly to a go home motion block followed by an end block. When Tom hits a line during testing in full screen mode, this script immediately resets him to his original position.
Advancing to the next page
The maze challenge ends when Tom reaches a flower character placed at the path's exit. To complete the stage, the flower is given a touch trigger block connected to a page block that switches from page two to page three. When Tom safely navigates the maze and touches the flower, the project automatically loads the next level, continuing Tom and Ben's quest for Angel's magic wand.
Part of the course
Scratch Junior
More in Module 8 - Wizard Palace
- 1Designing wizard palace8 Minutes
- 2Programming wizard palaceNow playing