Programming Your App
I recently added a problem (currently #4) to make the sprite non-draggable. Next year, we should edit all the images & videos on the remaining pages that currently show the box checked. --MF
On this page, you will choose a costume for a sprite, how to modify a costume, and how to have the sprite change costume when it is clicked.
- Make sure you have Snap! open (http://snap.berkeley.edu/run) and that you are logged in.
Create two "Alonzo" costumes for your sprite. The video below shows how, and below the video are detailed instructions.
These instructions explain the video:
Select "Costumes..." from the File () menu, choose "Alonzo," and click "Import" and then "Cancel."
Right-click (on a Mac, control-click) the Alonzo costume in the center Costumes area (as shown in the video above) and select "duplicate."
- Right-click (or control-click) the new costume called "Alonzo(2)", and select "edit."
- Click the "flip ⟷" button, and then click "OK."
Program the sprite to change costumes when it is clicked...
Click the "Scripts" tab above the center Costumes area.
Drag blocks into the center Scripts area to build this script. For more support, read the yellow box below.
You can find blocks in palettes with their matching color: purple for Looks, yellow for Control, etc.
Drag one block underneath another to snap them together. The thin white bar shows where the blocks will snap together if you release the mouse button.
Un-check the "draggable" box under the sprite name input box. This will keep players from accidentally dragging the sprite when they click it.
- Check your program: click on Alonzo on the white stage. If your script works, Alonzo should face the other way.