Click on object -
11-02-2012, 10:13 AM
See the attached screen shot from an Alice 3.1 project (using an alien instead of the hatter).
1) Create your event in the InitializeEventListeners method.
2) Clicking on the Add Event Listener button, and choose Mouse -> AddMousceClickOnObjectListener
3) Drag an if-control into the event code block. Select true as the default.
4) Replace the true (using the drop down menu), by choosing Relational (SThing) {==, !=} option.
5) select the (??? == ???) option, using the hatter for both options.
6) drag the {e getModelAtMouseLocation) parameter to replace one of the hatters in the == expression.
Good luck!
Don Slater
Alice Team
Carnegie Mellon University
|