alice-teacher Queue-up events

Don Slater dslater at andrew.cmu.edu
Mon Feb 21 07:23:18 EST 2011


Yes... That works nicely... It never occurred to me that adding or removing an element to a list would also have the default 1 second duration.

Thanks, James.

Don Slater

Sent from my iPad

On Feb 19, 2011, at 5:46 PM, James Vanderhyde <jvanderhyde at benedictine.edu> wrote:

> 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/
> 
> <eventQueue duration fix.a2w>
> 
> 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
> 
> _______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers


More information about the alice-teachers mailing list