World 2 · Events · Guide 1 of 5Free guide
What is an event?
Some programs run the moment you press play. Some wait for you.
Meet the hat block
Until now, every program ran the moment you pressed play. A hat block changes that. It sits on top of the strip and holds everything back until one thing happens. This one waits for a tap on the character.
So this one block says: wait for a tap, then run the rest of the strip.
See it work
Here is the same journey twice. First with no hat, so it goes the moment you press play. Then with a hat on top, so it waits. Watch both.
Same blocks, same journey, same star. The hat did not change where the balloon went — it changed when.
Your turn
Now you're the programmer.
Can you make the balloon wait for your tap?
Press play, then tap the 🎈 to send it to the 🌟.
Blocks
Your program
Go further
What happens if you take the hat off?
Pull the hat off your strip and press play. The balloon flies the same path, but it leaves without you — there is nothing left for your tap to do. Now put the hat back on and tap the balloon before you press play. Still nothing, because a hat only starts listening once you press play.
For grown-ups
A program that waits for something to happen, instead of only running top to bottom, is called event-driven — the model behind every button in real software.
Keep going
Next in World 2What happens when things bump? →Where this goes
Make a game other kids can play
The blocks on this page are a first taste. In a Kubrio project your kid builds a real game — powers, triggers, levels and all — and other kids get to play it.
