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.
Work with a Partner
  1. Make sure you have Snap! open (http://snap.berkeley.edu/run) and that you are logged in.
  2. Create two "Alonzo" costumes for your sprite. The video below shows how, and below the video are detailed instructions. Creating two Alonzo costumes
    These instructions explain the video:
    1. Select "Costumes..." from the File (File button) menu, choose "Alonzo," and click "Import" and then "Cancel."
      choosing the Alonzo costume
    2. Right-click (on a Mac, control-click) the Alonzo costume in the center Costumes area (as shown in the video above) and select "duplicate."
    3. Right-click (or control-click) the new costume called "Alonzo(2)", and select "edit."
    4. Click the "flip ⟷" button, and then click "OK."
  3. Program the sprite to change costumes when it is clicked...
    1. Click the "Scripts" tab above the center Costumes area.
      Scripts tab
    2. Drag blocks into the center Scripts area to build this script. For more support, read the yellow box below.
      when I am (clicked), next costume
      Palette categories: Motion, Looks, Sound, Pen, Control, Sensing, Operators, and Variables

      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.

      Creating the turn Alonzo script
  4. Un-check the "draggable" box under the sprite name input box. This will keep players from accidentally dragging the sprite when they click it.
    Draggable box un-check
  5. Check your program: click on Alonzo on the white stage. If your script works, Alonzo should face the other way.