Alice Programming Intro Finding Nemo Charades
Alice Programming Intro Finding Nemo Charades
2
Creating an Alice Program
3
An Extended Example
4
Getting Started
5
Create an Alice World
• Start Alice
• Select “File”, “New World”
• Click on Water picture
• Click on “Open”
6
Find Fish objects
• Click on “add
objects”
• Scroll over to
“people” folder and
click on it
7
Add Blueminnow to World
• Click on Blueminnow
(for Dory) and you
will see:
• Blueminnow appears in
world
• Can also add my clicking
on object and dragging into
scene
8
Add Pinkminnow to world and adjust
• Click on Pinkminnow
(Marlin) and add to the
world
9
Position fish and camera so world
should look something like this:
11
Add More Fish
• Add 5 Goldfish to world to be the
school of fish
• Clicking and dragging into scene works
better.
12
Move School of Fish Down
• In our movie the school of fish
will appear later. We want
them to disappear now.
• Could use the move down arrow
to move below surface but we
want them all to move down
same amount.
13
Move School of Fish Down
• Select each Goldfish from
Object Tree and drag into
scene
14
Position Dory and Marlin
15
Setup Done!
• All goldfish are below surface
of water, but still part of
world.
16
Save World
17
Now Ready to program!
• Click on done
• Should now see myFirstMethod
18
Make fish move
• This is the object tree, a
list of all your objects in
the world
• Now click on the word
“pinkminnow” to highlight
it
• You should see methods
below it (things the
snowman can do) such as
move, turn, roll, …
19
Add code to move fish
• Click left mouse button on
pinkminnow move AND HOLD IT
DOWN, then Drag it over to the
World.my first method and release
the mouse button
20
Move fish
21
Run the Program
• Click on Play
22
Have Dory move
• Select the blueminnow in the object
tree and drag over a move command
for it. Place it after the command for
the pickminnow
• Code is now:
• Play again
23
Sequential Execution
• Commands in the program are carried
in the order they appear.
• Alter order of movement so Dory
moves first and play movie. Click and
drag commands in the My first
method screen
– See the difference?
24
Movement
25
Duration
• Can change duration of actions by
clicking on more drop down menu in
command and picking duration.
26
Changing amounts
• Can also change amounts by clicking
on drop down menu for command.
• Change movement from 0.5 to 0.75
meters
• Play movie
27
Move together
• To get the fish to move together
drag a Do together command from
the bottom of the window into the
program
28
Move together
29
turn to face
• Click on pinkminnow to see
methods
• Select the turn to face
method from lower in list and
drag into program after the
move commands
• Select blueminnow from the
popup
• Play!
30
Have fish talk
31
Program so far
• Play!
32
Adding methods
• Program getting longer.
• We are going to have Marlin react to
Dory forgetting what Sydney is.
• We are going to repeat his reaction
twice
• To try and keep program simple and
to reuse commands we are going to
make a new method for Marlin,
33
Add a New Method
• Select pinkminnow in object tree
• In method tab click the create new
method button.
36
Call go crazy
• Select the My first method tab to go
back to the main program
• Call the go crazy method
• then have Marlin say "How could you
forget Sydney?"
• then call the go crazy method again
37
Calling new method
38
Move School of Fish Up
• Now have the school of
goldfish appear.
• They will all have to move up 1
meter at the same time.
• When a method involves more
than one object it should be a
world level method. (go crazy
was a class level method.)
• Select world from object tree
and create new method from
the object tab
39
World Level Method
• Call the new method
school appears.
• Add a do together
block and a
command to move
each of the goldfish
up 1 meter
• Call the method in
my first method
• Play!
40
Get Attention
• The leader of thge
school of fish want
sto get the
attention of Dory
and Marlin
• He is going to move
forwards and
backwards 7 times
quickly while saying
"We know how to
get to Sydney!"
41
Repeated Actions
• Create a method for the goldfish at the
front of the school named get attenetion
• One way would be to use multiple moves as
shown, but don't do this!
42
Loops
• Previous approach is cumbersome
• Instead, use a loop!
• Drag Loop from bottom of commands to do
together in get attention method
43
Loop
• Now add a single move
forward and backward
command to inside the
loop.
• Call get attention
method in my first
method
• Play!
• Make sure times
match for say and
total movement back
and forth. 2.8 seconds
44
Saving new classes and objects
• Creating the get attention method for
one goldfish does not give the other
goldfish that method.
• But we could save a new class with the
get attention method and then add
objects of that new, smarter type to our
program.
45
Saving New Classes
• right click on
goldfish in object
tree with get
attention method
and select save
object
• Name new class
Smart Goldfish
46
Using New Classes
47
Charades!
• Create new world level method named
charades
• Start by having the lead goldfish say
"Guess what we are and we will tell you
how to get Sydney!"
48
Changing Properties in the Program
• The school of fish are going to
pretend to be a propeller.
• This can be done easily by
changing the vehicle property of
the fish
• Select each fish besides
the center fish from the
object tree
• Select the properties
tab
• Drag vehicle property into
charades method and change to
goldfish at center
49
Change Vehicle Property
• Select entire Goldfish
• Repeat for all the
other goldfish except
the one at the center
of the group
50
Effect of Vehicle
• Now that the center when this goldfish moves
goldfish is the vehicle others move as if attached
for all the other
goldfish when it moves
the other goldfish
move as if they were
attached to that goldfish
• In charades method have center goldfish rotate
around 7 times
• Call charades from my first method and PLAY!
• Other properties can be changed as well (Color,
isShowing, opacity)
51
Completed charades method
52
My first method so far
53
Affecting subparts
• Go back to the get
attention method for
the lead goldfish
• We want the goldfish
to move its tail while
going back and forth
• In the object tree
select the lead
goldfish and expand
the object
54
Affecting Subparts
• Most objects have subparts
• The goldfish has a tail and right and left
fins
• subparts can be given commands just like
the whole object
• Add a Do in order block to the inside of
the do together block in get attenetion
55
Affecting subparts
• In the object
tree select the
lead goldfish's
tail
56
Moving the Tail
• Add commands in the do together to move
the turn the tail left .1 revolutions
• Then a loop to move right and left .2
• Then right .1
• Make durations .1 seconds
• To make more realistic change style to
abruptly
57
Completed get attention Method
58
Events
• Events are parts of the program that can
respond to user input
• Initially only event is when world starts
do the my first method method
59
Add an Event
60
Change Event
• Result of creating
new event show
• Use drop down
menu to change any
key to letter A
61
Change Event Handler
• Select goldfish with
get attention method
• Drag the get attention
method to replace the
nothing in the event
• Dragging and dropping
can be used to replace
many thing in Alice.
Green means it is okay
to replace!
62
Finished Event
63
Add 3D Text
• Go to the add
objects screen
• Go to end of
objects gallery to
the add 3d text
folder and click on
it
64
Add 3d Text
• Type in message to show at end of
movie and press okay
• Rotate 3d text so it faces camera
65
Make 3d Text Invisible
• Go back to programming screen
• Change property of 3d text to make its
opacity 0. (Don't drag into program just
change it)
66
Make 3d Text Visible
• Next drag opacity property into end of
my first method to change to 100%
• Play!!!
67
Add a Billboard
• Download an image
of the city of
Sydney from the
web and store it on
your computer
• From the File option
in the menu select
Make Billboard
68
Add a Billboard
• Browse to the
location of you
image and select it.
• Once added the
billboard can be
moved, resized,
given commands, and
have its properties
altered just like
other objects
69
Swim to Sydney
• Move Sydney billboard
to background
• Change opacity to 0
• Add commands for
Dory and Marlin to
guess and goldfish to
direct them to Sydney
• Have Sydney appear
and fish swim towards
it
70
Add Sound
• Add sound to world
• Select world in
object tree
• Select properties
tab
• click import sound
button (wav or mp3)
• drag sound into
program to play
71