alice-teacher s Digest, Vol 77, Issue 20

robert durtschi robert.durtschi at gcsu.edu
Tue Feb 28 12:46:01 EST 2017


Primary use I've made in While the World is Running is using during.
"while the world is running during: seaplane propeller roll 20 times, style abruptly
or
"while the world is running during: CollisionCheck method

the end option would not necessarily be for the world event.
for something like a key pressed event:
    Begin would be triggered on the leading edge of the key press.
    During would be detected as the key is held down.
    End would be triggered on the trailing edge of the key release.

What I suspect is happening in your case is that the event handler disappears when the program stops. What exactly did you put in the "end" section?

Bob Durtschi

________________________________


In Alice 2, you can right-click on the ?When the world starts? event and change it to ?While the world is running.? I?m not sure why this feature is useful, but it doesn?t seem to work completely. If you put something in the ?End? portion of this event, when you Play the animation and then Stop it (or close the window), you get the Queen reporting a NullPointerException. (See attached screenshot.)

I?m not sure what the correct behavior should be. I would like it to do the thing I said in the event before the window closes, but then arbitrary user code could generate an infinite loop and make the window impossible to close. Maybe hitting Stop during the End event could stop it for good, so you have to hit Stop at most twice to close the window.

Or maybe just remove the End option in the event, so we don?t see the error.




------------------------------

End of alice-teachers Digest, Vol 77, Issue 20
**********************************************

[http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20170227/5cffa6d7/attachment-0001.png]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20170228/b12cb367/attachment.html>


More information about the alice-teachers mailing list