alice-teacher Alice 3 Event Listener Question

Vanderhyde, James vanderhyde at sxu.edu
Fri Nov 10 11:38:08 EST 2017


I agree with Don’s solution. This works perfectly, and it is a good way to demonstrate to the students the usefulness of Boolean variables and logic. Pretty soon you start seeing logic everywhere.

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

On Nov 9, 2017, at 3:36 PM, Donald Slater <djslater107 at mac.com<mailto:djslater107 at mac.com>> wrote:

Emily,
One solution would be to create a Boolean variable for the Scene / World, maybe called isActive, with an initial value of true.

In the event, create an if... statement
if (isActive)

And then the work of the event would be inside the if statement code block...

You would set the isActive variable to false at the point in the program where the user should NOT be able to move the wolf.

Let me know if you have any questions...

All the best,
Don Slater

Alice Project

Sent from my iPad

On Nov 9, 2017, at 2:29 PM, Emily Higgins <erphiggins at gmail.com<mailto:erphiggins at gmail.com>> wrote:

Hi All,
I have a problem.  How can I make an event listener stop working?  We have an event listener moving a wolf, and at certain point in the program, the user needs to NOT be able to move the wolf.  I can't figure it out.

Thank you very much,
Emily Higgins
STEM/Gifted and Talented
Boothbay Region High School
_______________________________________________
alice-teachers mailing list
alice-teachers at lists.andrew.cmu.edu<mailto:alice-teachers at lists.andrew.cmu.edu>
To change settings or unsubscribe visit:
https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers
_______________________________________________
alice-teachers mailing list
alice-teachers at lists.andrew.cmu.edu<mailto:alice-teachers at lists.andrew.cmu.edu>
To change settings or unsubscribe visit:
https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers

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


More information about the alice-teachers mailing list