An event is something that happens — a click, a key press, a sensor noticing movement — that makes a program react. Games and apps are full of events that wait for the player to do something.
Apa yang akan dipelajari anak anda
- Know what an event is in a program
- Recognise event blocks such as “when ▶ clicked” and “when key pressed”
- Predict what a program does when an event happens
- Spot events in everyday machines
Waiting for something to happen
Scratch programs start with an event block like “when ▶ clicked”. A game might also say “when space key pressed, jump”. Nothing happens until the event occurs — then the script runs.
Real life is full of events too: pressing a lift button, a motion sensor switching on a light, or an alarm going off at 7 o’clock.
Contoh soalan
Berikut ialah beberapa soalan seperti dalam misi pertama. Bolehkah anda menjawabnya?
1. What happens in a Scratch program before its event happens?
- The sprite disappears
- The script runs again and again
- The computer turns off
- The script waits
Tunjuk jawapan
Jawapan: The script waits. Scripts wait until their event happens.
2. Which is an example of an event in real life?
⏰- An alarm clock ringing wakes you up
- A colour
- A book
- A chair
Tunjuk jawapan
Jawapan: An alarm clock ringing wakes you up. The alarm ringing is an event you react to.
3. What is an event in a program?
- Something that happens that makes the program react
- A costume
- A type of loop
- A sound file
Tunjuk jawapan
Jawapan: Something that happens that makes the program react. Clicks, key presses and touches are events.
4. Match each event to what happens.
- when green flag clicked
- when space key pressed
- when sprite clicked
- it says hello
- the sprite jumps
- the game starts
Tunjuk jawapan
Jawapan: when green flag clicked → the game starts · when space key pressed → the sprite jumps · when sprite clicked → it says hello. An event triggers some code to run.
Tip untuk orang dewasa
- Spot events at home: the doorbell, the microwave button, the automatic light.
- Play a game where different actions are “events” that make you do a move.