Scratch ConditionalsIf Then, If Else & Nested Logic
Learn how to make your Scratch projects smart and reactive. Use conditionals to detect collisions, handle win/lose states, and build real game logic — step by step.
What is a Conditional?
🔀 What is a Conditional?
Imagine a traffic light. When it's green, you go. When it's red, you stop. The light makes a decision based on a condition. In Scratch, conditional blocks do exactly the same thing — they check whether something is true, and only run blocks if it is.
✅ Without a conditional (always runs)
when flag clicked
say [You win!] — runs every time, even score = 0!
✅ With a conditional (smart!)
when flag clicked
if <score = 10> then
say [You win!]
end — only says it when score is 10
🧠 Key Idea — Boolean conditions
Every conditional needs a condition — something that is either true or false. In Scratch, conditions are diamond-shaped blocks called Booleans. Examples:
<touching edge?>→ true or false<key [space] pressed?>→ true or false<(score) > (5)>→ true or false
🌍 Real-world analogies
🚦
Traffic light
If green → go. If red → stop.
🌡️
Thermostat
If temp < 20°C → turn on heater.
🎮
Video game
If lives = 0 → show Game Over screen.
✅
If Then
Do something when true
🔀
If Else
Choose between two actions
🪆
Nested If
Check multiple conditions
Go Further with Live 1-on-1 Scratch Tutors
Worksheets are great — but live mentorship accelerates learning 10×. Join our Scratch Programming Course for Kids and build 20+ real games & animations with expert guidance.