Hi there, I'm making a game.
I have a problem in that I want to make sure that the program I'm making keeps track of the keys that are pressed and makes sure that the effect that occurs per key pressed only happens once.
So if I pressed the letter a once, then I could press a all I liked after that, but none of the scripts written for that key would run, until I restarted the game.
I am at a loss for how to do this.
Whoever can solve this for me gets a cookie!
Help with keyDown!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Help with keyDown!
Hi.
Not sure of the structure of your game. but try this on a new card with one field on it. In the card script:
Here a field "keeps track" of the keys already pressed. Perhaps this will give you a clue how to proceed?
Craig Newman
Not sure of the structure of your game. but try this on a new card with one field on it. In the card script:
Code: Select all
on keyDown tKey
if tKey is not in fld 1 then
--doSomethingWithEachNewKeyPress
put tKey after fld 1
end if
end keyDown
Craig Newman
-
- Posts: 4
- Joined: Thu May 26, 2016 12:47 am
Re: Help with keyDown!
Thanks! this solved my problem. You're a legend!