alice-teacher Alice 2 Issues with Object tree groups

Vanderhyde, James vanderhyde at sxu.edu
Thu Mar 30 14:48:51 EDT 2017


One of my students found an unexpected problem with Object Tree groups in Alice 2 today.

1. If you put an object under a group in the object tree, the object’s variables are not available for use in other objects’ methods. You can't drop the variable into a target parameter, and you can’t find the variable under “expressions” in the parameter, either. Maybe this is intended behavior; it enforces encapsulation. However, you can still drag the variable itself and turn it into an increment instruction, for example. So that is inconsistent.

2. If you put an object under a group in the object tree, and the object has object-level events, those events don’t work. This really seems like it must be a bug. To reproduce this, add a fire object (Special Effects) to the world. Note the object-level “When the world starts" event. The fire spins when you run the program. Now create a group in the object tree and put the fire in the group. Run the program and the fire will not spin. (We found the problem with a key event on something else; it is not just a problem with the fire.) This problem goes deeper: If you save the project, the next time you open it, the object-level events are missing. If you move the object out of the group to the top level, the events appear. So putting an object into an object tree group disables the object’s events.

My student was trying to organize his project (which he anticipates will have many objects) by putting the objects in groups in the object tree. He ran into the problem with the variables first. Today he asked me how to keep the Events organized, and I showed him how to use object-level events. Then he discovered the second problem.

James
—
James Vanderhyde
Assistant Professor, Computer Science
Program Director, Master of Applied Computer Science
Saint Xavier University
3700 W. 103rd St.
Chicago, IL 60655
773-298-3454

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20170330/15c75df5/attachment.html>


More information about the alice-teachers mailing list