alice-teacher delay question

James Vanderhyde jvanderhyde at benedictine.edu
Tue Jun 3 11:25:09 EDT 2014


The way to do this is to control the event with logic, rather than a timer. Create a boolean variable called “gameOn” or something like that that is initially false. When the countdown is finished, set the variable to true. In the arrow buttons events, put the action inside an if statement so the movement only occurs if gameOn is currently true.

I’m still on Alice 2, but there should be something similar in Alice 3.

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



On Jun 2, 2014, at 9:29 AM, JOHNSON JULIE M. <JJOHNSON at williamsvillek12.org<mailto:JJOHNSON at williamsvillek12.org>> wrote:

I do not want the user to be able to press the arrow buttons on the keyboard to start a race between two objects until the countdown is finished.  I tried a delay in the event listener but it did not work.
_______________________________________________
alice-teachers mailing list
alice-teachers at lists.andrew.cmu.edu<mailto:alice-teachers at lists.andrew.cmu.edu>
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/20140603/2116213f/attachment.html 


More information about the alice-teachers mailing list