Let's go on translating our storyboard on the previous page into Alice code. We'll stop after we add each instruction to make sure things are going OK. It's harder if we wait until the end and then find out something isn't working right.
Step 6: Next we'll create the part where the guy reacts to the beetle.
guy spins around once
guy moves backward
guy says "Aiii!"
It's the guy that is supposed to do something. Select the guy. You can either do this by clicking on the image of the guy in the world as shown here:
<click on me to make me bigger>
or by clicking on the object in the object list for the guy (his name is actually slackerProm) as seen here:
<click on me to make me bigger>
Step 7: Look in the methods area in the bottom left. Hmmm... I don't see a spin method. To make him spin, we can instead ask him to turn multiple revolutions. Drag the slackerProm turn tile into the code area, underneath the beetle move forward 10 meters tile. Select options left and then 2 revolutions.
<click on me to make me bigger>
Step 8: STOP!
Let's see if the computer did what we wanted. Hit play and observe.
So we made slackerProm spin, but we also want him to move backward 5 meters.
Step 9: Click on slackerProm move tile in the left bottom method area. Drag it to the code area, underneath the slackerProm spin 2 revolutions tile. Select options backward and 5 meters.
<click on me to make me bigger>
Step 10: STOP!
Let's see if the computer will do what we wanted.
Hit Play and observe.
[Q1.6.1]: What happened? Did your code implement this part of the storyboard?
guy spins around once
guy moves backward
guy says "Aiii!"
[Q1.6.2]: What is missing?
Step 11: Drag in the method tile slackerProm say from the bottom left into the code area and drop it after slackerProm spins and moves backward as shown here:
<click on me to make me bigger>
Step 12: Choose the option other and then type into the box Aiii! and click OK.
Step 13: Hit Play to see if the code does what you thought it would do.
Videos describing how you should have thought about this section:
English:
Spanish: