How do I prevent a Key being pressed down all the time?

William de Smet williamdesmet at gmail.com
Sat Sep 27 07:32:00 EDT 2008


Hello all,

For my little son (4 years of age) I am making a little car game in
which he can move a car around the screen using the arrowkeys.
I made a few obstakels (walls) so he has to move around them but when
he hits them he is send back to the beginposition.
Not to difficult for me to make :-)  and a lot of joy for him!!

But now I found a 'bug' in my own game :-(
When you keep the arrowkeys pressed down (instead of just one press)
and hits an obstakel there is now hit and he is not send back to the
beginposition.
How do I prevent this?

I use the following:
if theKeyNumber is 65363 --rechts
then move img "dummy" relative 30,0

if intersect (img "dummy", grc "muur")
then send mouseup to btn "start" -- btn start send the car beck to its
beginposition

Thanks!

William



More information about the use-livecode mailing list