Learn it
A condition is a yes-or-no question, also called true or false. In Scratch, condition blocks have pointy ends, like <touching [edge]?> or <(score) > (5)>.
Conditions fit inside if, if-else, wait until and repeat until.
๐งฐ Tool: free Scratch online editor (no account needed to try; a parent can create one to save projects) or the free ScratchJr app for tablets.
Code examples
Blocks (Scratch)
when green flag clicked
forever
if <touching [edge]?> then
say [Ouch, the edge!] for (1) seconds
end
move (5) steps
end
Project: True or false game
- Say 5 statements to a friend (‘Dogs can fly’). They shout true or false.
- In Scratch, find 3 blocks with pointy ends.
- Use one inside an if block.
Challenge: Make a sprite say ‘I’m near the top!’ when y position > 100.