alice-teacher delay question
Wanda Dann
wpdann at andrew.cmu.edu
Tue Jun 3 11:22:23 EDT 2014
On 6/2/2014 10:29 AM, JOHNSON JULIE M. 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.
>
>
> Perhaps use a boolean variable to track whether the countdown is
> finished. Declare a property variable for the Scene class and set it
> to false... see image here:
>
> countdownComplete variable
>
Then use the variable to prevent the arrowKeyPressed event
listener from taking action until the boolean variable becomes true, as
shown here:
boolean must be true or arrow press is ignored
Of course, you will need to set the variable to true when your countdown
is completed. Then, the arrow keys will become active.
>
> _______________________________________________
> alice-teachers mailing list
> 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/a0c49e36/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: booleanDelayActive.jpg
Type: image/jpeg
Size: 96812 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20140603/a0c49e36/attachment-0002.jpg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TimeDelayComplete.jpg
Type: image/jpeg
Size: 94722 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20140603/a0c49e36/attachment-0003.jpg
More information about the alice-teachers
mailing list