5. Events

Event code blocks enable you to listen for events and react as appropriate.

5.1. When start is clicked (green flag)

_images/00-when-green-flag-clicked.png

This code block listens for when start is clicked.

Code

5.2. When a key is clicked

You may listen for almost any key being clicked.

_images/01-when-space-clicked.png

This code block listens for when the space bar is clicked.

_images/02-when-up-clicked.png

This code block listens for when the up arrow is clicked.

_images/03-when-down-clicked.png

This code block listens for when the down arrow is clicked.

_images/04-when-right-clicked.png

This code block listens for when the right arrow is clicked.

_images/05-when-left-clicked.png

This code block listens for when the left arrow is clicked.

Code

5.3. When sprite is clicked

_images/06-when-sprite-clicked.png

This code block listens for when a sprite is clicked.

Code

5.4. When backdrop switches

_images/07-when-backdrop-switches.png

This code block listens for when a backdrop switches.

Code

5.5. When loudness exceeds

_images/08-when-loudness-exceeds.png

This code block listens for when the volume exceeds a threshold.

Code

5.6. When timer exceeds

_images/09-when-timer-exceeds.png

This code block listens for when the timer exceeds a threshold.

Code

5.7. When message received

_images/10-when-message-received.png

This code block listens for when a message is received.

_images/11-when-broadcast-message.png

This code block broadcasts a message.

_images/12-when-broadcast-message-and-wait.png

This code block broadcasts a message and waits.

Code