Understanding Events
An event is something that happens that Scratch can detect and react to. Every Scratch script must start with a hat block (the blocks with a curved top in the Events category).
Common Hat Blocks
- When 🏁 clicked — runs when the green flag is clicked.
- When (space) key pressed — runs when a specific key is pressed.
- When this sprite clicked — runs when the user clicks this sprite.
- When backdrop switches to (name) — runs when a specific backdrop is shown.
A sprite can have multiple hat blocks — they all run independently, at the same time, when their event fires.