Star Student Builder logoStar Student Builder
← Animation and First Games Std 3–5Project 3 of 4

A Maze to Escape

🎯 Steer a sprite through a maze you drew yourself. Touching a wall sends you back to the start.

πŸ’‘ The idea behind it

A program can sense colour β€” which is how a game knows you hit something without any collision code.

🧱 Blocks you will need

touching colour?go to x: y:foreverif … thenbroadcast

πŸ”¨ Build it

  1. Paint a backdrop: draw the maze walls in one single colour, thick enough to see.
  2. Shrink your sprite so it fits the corridors β€” 'set size to 25%' usually works.
  3. Move it with the four arrow keys, as in the last project.
  4. Add: forever β†’ if touching colour [the wall colour] β†’ go to x y of the start.
  5. Draw a green square as the exit, and: if touching colour green β†’ say 'You escaped!' β†’ stop all.

πŸš€ Make it harder

  • Add a timer and show how long the escape took.
  • Add a second level by switching the backdrop and moving the sprite back to the start.

🐞 Bugs you will hit

  • It always says you are touching the wall: the colour you picked does not exactly match. Use the eyedropper in the colour picker and click the actual wall.
  • The sprite slips through walls: it is moving more steps per loop than the wall is thick.

⬇ Need Scratch itself?

Free from MIT, in a browser or as an offline app that needs no connection at all.

Get it β†’
Ask GuruAcharya Samayeshwar