Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Spacbar pressed and released bug.

Author
Message
Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 17th Oct 2009 21:47
Well, I got a plane. And here I have some code that should check, that when you are flying and you press and then release spacebar. it go's to a landing sequence. And if you are not flying and press and then release spacebar it should go to takeoff sequence, exept that when I press spacebar and then release it, nothing hapens, my plane keeps flying.

Here is my code sofar:



Already alot of thanks to the persons that can help me solve this problem.

Isocadia.

PS: Another problem: When I'm pressing w, my plane goes down, but when I first press w and then press a, my plane only goes down, how come it is not rolling left and descending at the same time??
Ultimate_H
15
Years of Service
User Offline
Joined: 11th Mar 2009
Location: A place that is neither here nor there
Posted: 17th Oct 2009 22:27
It looks like the only way, with how your doing it right now, to have it work is if you hold space and then release it in the millionth of a second(or how ever long it is) it takes to go from the first if check to the second if check. I would do something like this:



where you do the checks separately, instead of inside each other like you are doing now. I do something similar to turn off auto-fire in games.

If I sound like I know what I am talking about, then I most likely have no idea what I am saying.

If I sound like i have no idea what I am saying, then I most likely know what I am talking about.

Login to post a reply

Server time is: 2024-10-01 14:44:34
Your offset time is: 2024-10-01 14:44:34