You are going to code an interactive game for your mobile device. The point of the game is for you to click on Alonzo as much as you can. Alonzo makes it harder by moving randomly around the screen.
First, you'll change the arrow-head sprite, , to look like the Alonzo character (wiggling here), and then you'll program him to turn when he is clicked.
-
Bookmark or write down the snap link. You will need it every day.
Use the URL http://snap.berkeley.edu/run to launch Snap! in a new window (or tab).
-
Create two costumes for the sprite. You can follow these instructions or watch the animation below.
- Go to the File menu, and select "Costumes...". Choose "alonzo.gif".
- Right-click (or, on a Mac, control-click) the Alonzo costume in the gray costume area (not on the white stage) and select "duplicate."
-
Then, right-click (control-click) the new costume, select "edit," and click the "flip ⟷" button.
Then, click "OK."
-
Drag one block underneath another to snap them together. The white bar shows that the blocks will snap together if you unclick the mouse here.
The blocks' colors match their palettes: purple for Looks, yellow for Control, etc.
Now, program the sprite to change costumes when Alonzo is clicked.
Click the "Scripts" tab above the staging area, and drag blocks into it to build this script:
This animation shows where to find the blocks and how to snap them together:
- Click on Alonzo, on the white stage. If your script works, Alonzo should face the other way.