🚦🟥🟨🟩Code the Lights! Create a Realistic Traffic Signal System in Scratch – Perfect for Kids & Beginners!
- Sandra Sabu
- Dec 11, 2025
- 1 min read
Create a working traffic light system that changes from red ➝ yellow ➝ green, with a car sprite that moves only when the light is green.
🧩 Step-by-Step Instructions
Step 1: Set the Scene
Click on Choose a Backdrop, then select the colour full city backdrop.(you can select any backdrop as your wish)
Delete the cat sprite.
Click on Choose a Sprite and add the car sprite to your project.
Create new circle sprite with colours 🟥🟨🟩
Create a line sprite

Step 2: Add Variables
Go to Variables → Make a Variable → Name it: canMove
This will control whether the car can move or not.
when green flag clickedforever // RED Light set [canMove v] to [no] switch costume to [red v] wait (3) seconds // GREEN Light set [canMove v] to [yes] switch costume to [green v] wait (3) seconds // YELLOW Light set [canMove v] to [no] switch costume to [yellow v] wait (1) secondend
✅ Final Test
Click the green flag and when green shows the car moves ,when red and yellow shows the car stops.
🚦💬 “From red to green, you've just coded the traffic scene! You're not just learning to code — you're coding to learn! Keep going, young programmer — the world runs on logic, and now, so can your imagination!”



Comments