alice-teacher Queue-up events

James Vanderhyde jvanderhyde at benedictine.edu
Sat Feb 19 17:46:25 EST 2011


Don (and all), 

It looks like you can remove the pauses between the events by setting the duration of adding to the list and removing from the list to 0. Please see attached, if interested.

I believe this solves Mike's original question.

James
--
Dr. James Vanderhyde
Math and Computer Science
Benedictine College
jvanderhyde at benedictine.edu
http://vanderhyde.us/~james/pro/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: eventQueue duration fix.a2w
Type: application/octet-stream
Size: 1763623 bytes
Desc: not available
Url : https://lists.andrew.cmu.edu/mailman/private/alice-teachers/attachments/20110219/c55fd064/attachment-0001.obj 
-------------- next part --------------

On Feb 18, 2011, at 11:27 AM, Don Slater wrote:

> Sorry, let me attach the world this time ;-(
> 
> ---
> 
> <eventQueue.a2w>
> 
> See the attached example world which uses an event queue instead of a boolean flag. 
> 
> I have created a list of objects called events in World properties.
> 
> I have a World eventsHandler method which adds each object clicked on to the list.
> 
> I have a "while object is true event" that continues to fire as long as the list is not empty, calling the World processNextEvent method.
> 
> processNextEvent gets the next available object from the list, and then, depending on the object, calls the method I want the method to perform.
> 
> What I am unhappy about is the length of time it seems to take Alice to do the list processing. This may be an artifact of the way I wrote the code, or it may be just the way Alice handles lists.
> 
> Let me know if you have any questions.
> 
> All the best,
> Don Slater



More information about the alice-teachers mailing list