๐ Quick Study Guide: Events & Actions in Scratch
- ๐ก Events: These are the "triggers" or "starters" in your Scratch projects. They tell your code *when* to run. Think of them as the 'cause'.
- โ๏ธ Actions: These are the "responses" or "commands" that execute once an event is triggered. They are the 'effect' or what actually happens.
- โถ๏ธ Common Event Blocks:
- ๐ฉ
when green flag clicked: Starts the whole project.
- โจ๏ธ
when [key] pressed: Responds to keyboard input (e.g., arrow keys, spacebar).
- ๐ฑ๏ธ
when this sprite clicked: Activates code when a user clicks on a sprite.
- ๐ผ๏ธ
when backdrop switches to [backdrop]: Triggers actions when the stage background changes.
- โ๏ธ
when I receive [message]: Allows sprites to communicate and react to messages broadcast by other sprites.
- ๐ Common Action Blocks: These are the blocks found in categories like Motion, Looks, Sound, Pen, Data, etc., that make things happen.
- ๐ถโโ๏ธ
move (10) steps, change x by (10): For movement.
- ๐ฃ๏ธ
say (Hello!) for (2) seconds, switch costume to [costume]: For appearance and dialogue.
- ๐
play sound [Meow] until done: For audio.
- ๐ฉ
broadcast [message1]: Sends a message that other sprites can receive as an event.
- ๐ The Link: An event block always sits at the top of a script, waiting for its specific condition to be met. Once met, the blocks stacked below it (the actions) execute. It's a fundamental concept for making interactive and dynamic projects!
โ๏ธ Practice Quiz
Choose the best answer for each question.
-
Which of these is an example of an "event" in Scratch?
- Moving a sprite 10 steps.
- Changing a sprite's color effect.
- Clicking the green flag to start the project.
- Playing a sound until done.
-
If you want a character in your game to jump when the player presses the "space" key, which event block would you use to initiate the jump?
when green flag clicked
when space key pressed
when this sprite clicked
when backdrop switches to [jump_scene]
-
A common "action" block used to make a sprite change its visual appearance is:
when I receive [message]
broadcast [message1]
switch costume to [next costume]
wait (1) seconds
-
What is the primary role of an "event" block in a Scratch script?
- To define the visual style of a sprite.
- To perform a calculation or logical operation.
- To act as a trigger that starts a sequence of actions.
- To store data for later use.
-
A game character needs to say "Game Over!" when it touches the edge of the screen. While "touching edge?" is a sensing condition, which *event-related* concept would typically be used to trigger the "Game Over!" message in a structured way across multiple sprites?
when green flag clicked
when this sprite clicked
broadcast [Game Over] (and other sprites listen for it)
when backdrop switches to [start_screen]
-
Consider a project where different music plays for different levels. Which event block would be most suitable to start a new song when the level changes?
when space key pressed
when loudness > 10
when backdrop switches to [level_2_background]
when timer > 60
-
In the sequence: "User Clicks Sprite" -> "Sprite Says 'Hello!'", what is the "User Clicks Sprite" part?
- An action
- A variable
- An event
- A loop
Click to see Answers
- C
- B
- C
- C
- C
- C
- C