Alice

Lab 6 – Part 1

Soccer Practice

Jason and Jake play for the Gamecocks soccer team. The fall game season has started and the team has to practice every night. Jason and Jake have been paired up to practice their kicks and saves together. Jake shoots first and is able to fool Jason with a low kick. Jason, thinking that Jake will shoot the ball high, jumps but misses the ball. Jake is of course happy about his early goal but Jason is upset he missed the first shot.

Algorithm

Do the following:

  • The scene starts with both Jason and Jake standing in a neutral position
  • Jake prepares to kick the ball by moving his arms up and his right leg back
  • Jake kicks the ball
  • Jason raises his arms up and jumps to catch the ball
  • The ball enters the goal
  • Jake is happy about the goal he scored
  • Jason is upset that he missed the first shot

Creating the World

  • Run Alice. On the “Welcome to Alice!” box that appears, click on the “Templates” tab. Select the “grass” template, and click “Open”.
  • Click the “ADD OBJECTS” button of the world window.
  • Locate the “People” object folder under the “Local Gallery” and click the folder to open it.
  • Add two males to the world using the “hebuilder” object. Name one of them Jake and the other Jason.
  • Click on “Search Gallery” and type “soccerGoal” in the search that appears. Click the “Search button and wait until the search process is completed. Add a goal to the world.
  • Repeat the same search process for “soccerBall”. Add a ball to the world.
  • Positioning:
  • Position the soccer goal at a diagonal facing the camera
  • Position Jason at the same diagonal right in front of the goal
  • Position Jake close to the camera and facing Jason and the goal
  • Position the ball in front of Jake’s right foot
  • Click “Done” to return to the default view.

Translating the Algorithm into Program Code

  • Across the bottom of the editor panel (main yellow panel below world window) is a list of control flow statements. Select “Do in order”, drag it, and drop it into the editor panel.
  • Both Jake and Jason start with the neutral standing pose. Use the “stand” method for each and place both in a “Do together” control flow statement.
  • Do together:
  • Click on the + sign next to “Jake” on the object tree. Click on “LowerBody”. In the details area, click on the “properties” tab. Drag and drop “rightlegpass” into the “Do together” statement. This will cause Jake’s right leg to bend back.
  • Click on the + sign next to the “UpperBody” part of “Jake” in the object tree. Do the same with the + sign next to “Chest”. Finally, click on “RightUpperArm”. In the details area, click on the “methods” tab. Now, use the “roll” method to roll the arm to the left by 0.12 revolutions.
  • Click on “LeftUpperArm” part of “Jake” in the object tree. Now, use the “roll” method to roll the arm to the right by 0.12 revolutions.

The last two methods will make Jake lift his arms up slightly in preparation for kicking the ball.

  • Using the same approach described above to locate the various parts of Jake, do the following.
  • Turn Jake’s right thigh forward by 0.12 revolutions
  • Turn Jake’s right thigh backward by 0.12 revolutions
  • Turn Jake’s right shin backward by 0.18 revolutions

Note that these actions do not occur together but in sequential order. The net effect is Jake lifting his right leg up and backward and then forward to kick the ball.

Follow the nesting of actions shown below. The net effect of this set of actions is Jake returning to a neutral position after kicking the ball and Jason extending his arms and jumping up to catch the approaching ball.

  • Do together:
  • Move the soccer ball to the soccer goal
  • Do together:
  • Set the pose for Jake’s upper body to neutral
  • Set the pose for Jake’s lower body to neutral
  • Do in order:
  • Do together:
  • Turn Jason’s RightUpperArm to the left by 0.4 revolutions
  • Turn Jason’s RightUpperArm to the backward by 0.1 revolutions
  • Turn Jason’s LeftUpperArm to the right by 0.4 revolutions
  • Turn Jason’s LeftUpperArm to the backward by 0.1 revolutions
  • Move Jason up by half a meter
  • Move Jason down by half a meter
  • Have Jason stand in a neutral pose
  • Do together:
  • Jason becomes angry (use the angry method)
  • Jake becomes happy (Use the happy method)
  • Jake says “Goaaal”

Lab 6 – Part 2

Now that you have learned the basics of Alice, it is time to use your creativity to develop a short story and translate it into the world of Alice. What takes place in the story is up to you but the following elements must be included in the world you create.

1)An environment. You may use any of the objects in the Environments folder of the gallery or create your own environment using multiple objects (e.g. sky, trees, flowers, lake, etc. )

2)One or more persons (use the he and/or she builder).

3)Use any of the movement methods (e.g. move, turn, roll, etc.) for the person(s). You must use these methods for both the entire person object and one or more of its sub-objects (e.g. left arm, left leg, etc.)

4)Use the “say” method for at least one object.

5)Use any of the movement methods for at least one other object besides the person(s) and the environment.

6)Use the “Do in order”, “Do together”, and “Loop” control statements.

Note: There are many more objects in the online Alice gallery. It is a good idea to browse the online gallery, look up the name of the objects you want but that are not included in the local gallery, and then search for the objects using the “Search Gallery” tool in Alice. The online gallery can be found at