Learn Alice in FREE step-by-step lessons.
Unit III: Control Structures

Animation is created in Alice by moving objects a little bit at a time using several different control structures.
In this chapter, you will learn how to use several important control structures in Alice to control the sequence and repetition of actions. You will use doInOrder to perform actions one after another and doTogether to perform actions at the same time. You will also work with the count and while loops to repeat actions and learn how to combine these control structures to create more complex 3D animations. In addition, you will learn how to create and edit markers and use them in animation code. Finally, you will explore object subparts and learn how they can be used to create more detailed and realistic movements in your animations.
Objectives:
- Utilize control structures in your code;
- Determine which control structures to use for more natural movements;
- Implement loop control structures count and while to wave, clap, shake the head, and stomp the feet!;
- Use markers to move an object to a set position.;
- Edit object markers: add, delete, re-rename, and change the color;
- Create an animation that uses several subparts, such as walking.
Please study the material at each of the links below.
Control Structures: Control structures control the order in which statements are executed.
Using a count loop to count to 3.: Use count control structure to count to 3.
Using a count loop to shake head no.: Use count control structure to shake head no 3 times
Using a count loop to wave: Use count control structure to wave 3 times- While Loop: A while block is a control structure that loops (repeats) while a condition if true. The statement while(count<5) will cause the block to execute until count is 5 or more. The statement while(True) will create an endless or infinite loop.
3 Guys take turns counting: Using a while loop to count using counter=counter+1
Count down and blast off!: Counting down with a while loop: 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 blast off!
Scope of variables: It's important where you declare variables.
Yeti circles around baby penguin: Uses an endless while loop to circle continuously.
Fish swims back and forth: It's important to start and end in the same position.
Moose and skunk move between marked locations: Markers let objects move to a marked position.
Pixie moves between marked locations: Pixie moves between several markers.
Editing markers: Edit object markers: add, delete, re-rename, and change the color
A Walking algorithm: Get into position, take three steps, return to starting position.
Self-Study Questions: What have you learned?
Active Learning: Animation: Show what have you learned
Discussion questions: What do you think?
Glossary for Creating Animation in Alice3
Full Glossary