In this lesson, you will learn what each event block does.
The event blocks are the ones that are colored in yellow. Let’s learn what each block does.
The “when green flag clicked” block
The “when green flag clicked” block runs the script attached to it when the green flag is clicked.
The “when space key pressed” block
The “when space key pressed” block runs the script attached to it when the specified key is pressed. You can select a key from the drop-down menu.
The “when this sprite clicked” block
The “when this sprite clicked” block runs the script attached to it when the selected sprite is clicked.
The “when backdrop switches to backdrop1” block
The “when backdrop switches to backdrop1” block runs the script attached to it when the backdrop switches to the specified backdrop. You can select the backdrop you want from the drop-down menu.
The “when loudness > 10” block
The “when loudness > 10” block runs the script attached to it when the loudness is greater than 10. You can select “timer” from the drop-down menu and change the number 10 to any number you want.
The “when I recieve message1” block
The “when I recieve message1” block runs the script attached to it when it recieves the message selected from the drop-down menu. Messages can be created. They are used to let sprites communicate with each other.
The “broadcast message1” block
The “broadcast message1” block sends a message to all sprites including the background. We can create and name new messages.
Let’s create one.
Step 1: Select “new message” from the drop-down menu.
Step 2: Write message name in the blank and then click “OK”.
The “broadcast message1 and wait” block
The “broadcast message1 and wait” block sends a message to all sprites including the background and waits until all scripts attached to to the “when I recieve message” block in all sprites including the background finish, the blocks following the “broadcast message1 and wait” block get run. You can select a message name from the drop-down menu or create a new one.
The “when stage clicked” block
The “when stage clicked” block runs the code attached to it when the stage is clicked. You can see this block only when the background is selected.