Lecture 6 – September 13, 2007
Mike Ware on
"Terence_WashingtonDance.a2w" world from this site: http://coweb.cc.gatech.edu/ice-dev/111
"Objects and Arrays" world from this site: http://www.personal.psu.edu/jas86/research/aliceworlds.html
We looked at an existing program:
attributes
methods
creating events
briefly talked about control structures
if
looping
do together – concurrency
input
key presses
mouse clicks
output
object movements
people talking
sound
We discussed
no syntax
errors since
concurrency
in Java vs.
in Java, have to use threads
in
We did not talk about functions – it’s something for you to explore
In-class assignment:
Create
a world where a "person" object has a magnet (in the Objects folder)
held out in the person's
left hand. Add three metallic objects (in the Objects
folder) of your choice to the world and one by one
have the person point the magnet at each object. As
the person points the magnet toward an object,
have the object move to the magnet. Have the last
object be very large (perhaps a car from the
Vehicles
folder) so when the person points at it, the person is instead pulled toward
the object WHILE
saying something like "Whoa!" or
"Yikes!".
At a
minimum, your program should do the above. Then, you can add whatever you would
like to your
world: sound, user input, animation, different camera
views, etc.
HINTS:
(1) use the vehicle property
for help in making the object move in coordination with the person's hand
(2) use the move toward method
to make an object move toward another object
(3) use the orient to method
to orient objects with the person
RESOURCES: