Alice Tutorial #2 - The Bunny and the Phone

Methods

Today's lesson is about methods.  A method tells the computer HOW to do something.  For example, here is a method for eating:

In Alice, you will be writing methods that tell objects how to move.  
The ice-skater in Tutorial #1 has a method that tells how to do a Simple Spin, similar to this:

     This is a picture of the
        commands that are in the method for doing a simple spin.  

Do together means two movements happen simultaneously - she raises her arms and stretches one leg.

Loop means that something is repeated several times - in this case, a half turn is repeated 5 times.

img2.gif  img3.gif  img2.gif img3.gif   .....

At the end, she strikes another "pose".

Story Line

Each World has a story-line with a list of actions that will happen.  This is similar to a story-board for a video editor (like Movie Maker).  
For today's Tutorial #2 (about the rabbit and the cell phone), the world's story-line looks like this:

        img4.gif

Each command is the name of a method.  Each method contains a list of commands.
For example, "bunny shushes the phone" looks like this:

img5.gif

"Say" makes a message pop up on the screen.  

img1.gif

The "Cellphone.ring" method refers to another set of commands.  Inside the .ring method it looks like this:

      img6.gif

Each command can be "opened up" to show the details of the method (e.g. a list of commands).  
Even a very simple animation like the bunny consists of hundreds or thousands of commands.  

We use methods for two reasons:

What to do Today ....

  1. Run Tutorial #2 - Defending Naptime.  Do the entire tutorial, following directions carefully.
     
  2. Figure out which methods make each of the following happen, then change it:
    - the bunny jumps up and down on the phone - make him jump one extra time
    - the phone makes noise - turn off the noise
    - the bunny goes to sleep - change it so he hops away instead of sleeping at the end
     
  3. Add some more to the end of the story, for example:
    - the bunny wakes up and yells at the phone
    - he hops back over and kicks the phone
    - the phone flies away
    - the bunny says "Yeah" and then falls asleep
    - anything else you can think of
    You don't have to do this exactly, but do add a few more actions.
    Be sure to create a method for each of these actions.