ST EK List
No Ek's found

Greeting the Player

Pair Programming Swap

Your Click Alonzo script runs when Alonzo is clicked. On this page, you'll make a second script that welcomes the player when the green flag (green-flag button) is clicked.
a yellow round-topped hat block that says When

Blocks that look like this can be used to detect an event such as clicking on the sprite, pressing a key, or clicking the green flag button. They tell the script to start when that event occurs. Because these blocks can sit only on top of a script (as a way to start the script), Snap! programmers call them "hat blocks."

Clicking the green flag (green-flag button) starts all scripts that begin with the when green flag is clicked hat block. You can stop all running scripts by clicking the red stop sign (stop button) at the top right of the Snap! window.

  1. If it isn't open already, open your U1L1-ClickAlonzo project.
  2. You can do this using just 3 blocks including: when green flag clicked
  3. Create a second script that makes Alonzo move to (190, -130) and say a welcome message whenever the green flag is clicked. (Alonzo might say, "Welcome to 'Click On Alonzo!' Keep clicking me if you can!") .
  4. Make that message disappear when the player clicks on Alonzo.
    The say () block with an empty input will make the sprite say nothing.
  5. Check that your app does everything you want:
    • When the green flag is clicked, Alonzo should move to (190, -130) and say its message.
    • When Alonzo is clicked, the message should disappear, and Alonzo should move to a random spot on the stage and face the other way.
  6. Now Is a Good Time to Save