Alice Tutorial

Alice: A Free 3D Animation
World for Teaching
Programming
Barbara Ericson [email protected]
Georgia Institute of Technology
Oct 2005
What is Alice?


Free 3d animation software
 From Carnegie Mellon University
 Available from http://www.alice.org
Used to teach
 Programming concepts






Objects and classes
Methods, functions, and properties
Conditionals (if and else)
Iteration (looping)
Recursion
Event-driven programming
Georgia Institute of Technology
Alice Requirements


Modern Computer
 500 MHz CPU or better
 128 MB RAM or better
 Video resolution of 1024 by 768 or better
 VGA graphics card with 16 bit or better color
 A sound card
Does work on windows and macs
Georgia Institute of Technology
Why Learn to Program?

Number of CS Majors is down 40%


Predicted to be one of the fastest growing fields
through 2012


US Dept of Labor
The number of jobs in computing is now greater
than in 2001


Since 2001
And growing
We are facing a massive shortage of people

With knowledge of computing
Georgia Institute of Technology
Why don’t Students want to Program?

Myth: all the jobs are going overseas


Myth: You have to be a nerd or geek


Less than 1% have
Programming won’t turn you into a nerd or geek
Students perception of programming:






Too hard
Not interesting
Not relevant
Not creative
Not social
Too math based
Georgia Institute of Technology
Why Use Alice?

Students find using Alice

Easier than textual programming


Motivating


Students are used to 3d games and animated movies
Creative


People love to tell stories
Relevant


No syntax errors
Like being the director of a movie or play
Social

Share what was created
Georgia Institute of Technology
Getting Started

Install Alice


Start Alice


Copy folder from CD
Double Click on Icon
(Alice.exe)
Wait for Alice to start

Can take a few minutes
Georgia Institute of Technology
Pick a World

Click on the Examples
tab


And click on a world to
open it
You might need to scroll
down to see this world
Georgia Institute of Technology
Playing the Movie

To play a saved movie


Click the Play button
The movie or game will
start to play in a
separate window

Click on target to play
this movie

Most example worlds will
just start to play
Georgia Institute of Technology
Create Your Own Movie

Click on File


Then New World
Click on a template

Background and ground
type
Georgia Institute of Technology
Add Objects To the World



Click the Add Objects
button
Select an Object
Category from the
Local Gallery
Select Local Gallery
to get back from a
category

To the list of categories
Georgia Institute of Technology
Add Objects to the World

Select an object to add

Click on object to select


Click Add Instance to
world Button
Or drag the object and
drop it into position in the
world
Georgia Institute of Technology
Position an Object in the World

Once the object is in
the world

You can move it by



Dragging it with the
mouse
Or using the mouse
controls
Click the Undo button
to undo the last action
Georgia Institute of Technology
Mouse Controls

Use mouse control buttons (from left to right)







To move object left, right, forward, back
Up and down
Turn left or right
Turn forward or backwards
Tumble the object (free rotation)
Resize object
Copy the object
Georgia Institute of Technology
Deleting an Object

Click on the object you
want to delete


The object will be
displayed with a
bounding box around it
Click the right mouse
button

Select delete from the
pop-up menu
Georgia Institute of Technology
Posing an Object

You can move just a
part of an object


Select a part to move
with the mouse


Click affect subparts box
under mouse controls
Mouse controls will affect
just that part
Or use the object tree

To pick the part to move
Georgia Institute of Technology
Ask Objects to do Things in Methods

In object-oriented
programming we ask
objects to do things



They can refuse
They ‘know’ how to do
things
In Alice we will do this
in a method


Please
clean your
room
Sure
A named set of requests
to objects
The play button executes

world.my first method
Georgia Institute of Technology
Viewing Methods


Click the Done button
to stop adding objects
to your scene
Click the object that you
want to do something


In the object tree
Click on the Methods
tab

To see the methods this
object already knows
Georgia Institute of Technology
Use Methods

Drag method names
from the details window
Methods area


to world.my first method
Can Group Methods

Do in order


One after the other
Or Do together

At the same time
Georgia Institute of Technology
Moving and Deleting a Method

You can pick up a
method and move it



Click on left (dotted)
edge and drag it
Legal places to drop it
will have a green line
To delete move to the
trash can

Or right click and pick
delete from the popup
menu
Georgia Institute of Technology
Posing an Object using the Menu

You can also use a
popup menu to pose an
object

Right click on an object in
the object tree to bring up
the methods


Select a method to
execute it
Click on the Undo button
to undo this action
Georgia Institute of Technology
Quad View
Click here to see Quad View

Use the Quad View to
get multiple views of
your objects






Normal camera view
From the top
From the right
From the front
Can zoom
And move the view
Georgia Institute of Technology
Camera Controls

Use camera controls to
change the starting
camera view



Move up, down, left, right
Drive forwards,
backwards, rotate left,
rotate right
Tilt (rotate) camera
forwards or backwards
Georgia Institute of Technology
Saving a World


Click on File and Save
World
Tell it where you want
to save it


Give it a name
To open a saved world

Click on File, Open World

Pick the saved world
Georgia Institute of Technology
Creating a Method

To teach an object to
do a new thing




Create a new method
Name the method
Drag other methods into
the new method
When you are done use
the new method in
world.my first method
Georgia Institute of Technology
Creating a Class

A class can ‘inherit’ from an existing class

Right click on object in object tree and rename it


Create copies of the object using mouse controls


Right click and select save object (really save class)
Know the same methods
To make the methods work on any object of the
class


Add a parameter for the object that it is invoked on
To move sub-parts need part named function

Be careful typing the name of the part
 Case sensitive
Georgia Institute of Technology
Creating People

You can use the she
builder and he builder
to build custom people


In the people category
Control the skin color,
hair, eyes, body, and
clothes
Georgia Institute of Technology
Saving a Position


Click the more
controls button
Drop a dummy




At the camera
Or at an object
Can move the
camera to a dummy
Can set an object to
the dummy’s
position
Georgia Institute of Technology
What can you teach with Alice?

Basics of Object-Oriented Programming



Objects and Classes
Methods and Parameters
Inheritance (the concept of it)








Alice doesn’t fully support inheritance
Iteration (looping)
Conditionals
Recursion
Lists and list processing
Arrays
Algorithm design, implementation, and testing
Basics of Event-driven programming
Georgia Institute of Technology
Alice Tutorials


Click on File then Open
World
Click on the Tutorial tab


And then click on a
tutorial to run
When you finish with one
tutorial do the next the
same way
Georgia Institute of Technology
Resources

Web site


Book: Learning to Program with Alice



Wanda Dann, Stephen Cooper, Randy Pausch
Short Workshops at Georgia Tech


http://www.alice.org
Check web site for teacher workshops
http://coweb.cc.gatech.edu/ice-gt/
Summer 2-day workshops across the country
Curricular materials

http://aliceprogramming.net/
Georgia Institute of Technology