1.5 Storyboard -> Code (part 1)

Translating the Storyboard into Code:

Here's a copy of our storyboard for us to refer to:

Do these things in order

beetle moves out from behind the tree

guy spins around once

guy moves backward

guy says "Aiii!"

ringoBeetle moves out from behind the tree

ringoBeetle says "Sorry, his leash came off."

Step 1: To tell Alice to do your instructions one at a time, drag a Do in order tile from the very bottom of the Alice window into the program area as shown in the figure below.

<click on me to make me bigger>

Step 2: Instruct the computer to have the beetle walk out. In the object list area (upper left) click on beetle. Then make sure the methods tab is selected in the bottom left pane. (A method is a computing word for an instruction or action, and we will use it interchangeably with those words.) From the methods tab in the lower left, drag the beetle move tile into the program area as shown here:

<click on me to make me bigger>

Step 3: When you let go from dragging it will ask you to pick a direction and an amount: Pick forward and then 10 meters.

<click on me to make me bigger>

Step 4: STOP!

You have just given the computer it's first instruction in Alice! The tile shown in the code area (bottom right) is an instruction you are giving the computer. It will do this instruction when you hit Play. Obviously, there are many more instructions we need to add to complete the whole story. But we don't have to wait. We can (and we should) go ahead and check to see if the computer is following the directions as we intended it to.

Step 5: Hit Play and observe to see if a beetle walks out from behind the tree. Hit the stop button to close the scene when it's done.

Woah! Where did the beetle come from? Behind the tree, yeah. But how come I didn't see him before? If you click on the beetle object in the list of objects (top left) and pay close attention, you will see a yellow part of a box sticking out from behind the tree as shown here:

<click on me to make me bigger>

You can't see the beetle because in this 3-D world, the beetle was positioned to be behind the tree in the world design (if you are confused, watch this video showing how this world was designed and/or see Appendix A about how to set up a world by placing objects in it). Setting up a scene you have to pay close attention both to the placement of all the objects and to the view your audience will see.

OK, this is good! We know that we can get the computer to follow at least one instruction.

At the end of each section in Module 1 you will find a video narrating how you you should think about the problems you are solving when going through these modules. (There are videos in both English and Spanish).

English:

Spanish: