alice-teacher switching which object is controlled by arrows

Roger Wistar rwistar at hotchkiss.org
Wed Nov 23 09:48:31 EST 2011


Emily, since the selected fish is more of a persistent world property, I would probably just create a world variable of type Object and assign it to the appropriate object when it is clicked. Then you can have the arrow keys move the object referenced by the variable without them needing a parameter to determine which one it is.

Roger Wistar
The Hotchkiss School

From: alice-teachers-bounces+rwistar=hotchkiss.org at lists.andrew.cmu.edu [mailto:alice-teachers-bounces+rwistar=hotchkiss.org at lists.andrew.cmu.edu] On Behalf Of Emily Higgins
Sent: Thursday, November 17, 2011 11:13 AM
To: Alice educators
Subject: alice-teacher switching which object is controlled by arrows

Hello -
Thank you to the person that reminded me to put my topic in the subject line.  I have a student who is trying to make a scene in which the user can choose which object to control with arrow keys.  The objects, both fish, moves fins all the time, so he both needs to have the selected fish do its "swim" method and be controlled.  Then, if the user clicks on a different fish, that fish should do its "swim" method and be controlled by arrows. It seems like I should be able to have him use a parameter that is assigned upon being clicked and then switch with fish is swimming or being controlled.

Thank you,
Emily Higgins
Boothbay Harbor, Maine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.andrew.cmu.edu/mailman/private/alice-teachers/attachments/20111123/22c05d33/attachment.html 


More information about the alice-teachers mailing list