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.

DarkBASIC Discussion / Letter Trouble (should have learned the alphabet)

Author
Message
Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 16th Sep 2005 03:53
I have a problem:

I'm using the tradition controls (wasd) for an fps, and, with the help of "scancode()" it works fine, except for when you press two letters, like w and a. In this case, it just accepts the last one you pressed, so you can't move in angles.

Help Please?

--------------
Uncle Sam
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 16th Sep 2005 04:21 Edited at: 16th Sep 2005 04:22
Ooh ooh - I think I know this one!

I think it's keystate() that you use to check the code of the keys you are interested in.

So instead of doing


use



That way - you're not checking to see if just one key is pressed.

I'm fairly sure that's how it's done
Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 16th Sep 2005 05:04
Works perfectly!

Thank you.
You're a genius!

--------------
Uncle Sam
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 17th Sep 2005 05:08
Nah, just seen the same question asked before. No genius here.

Login to post a reply

Server time is: 2025-05-22 17:49:06
Your offset time is: 2025-05-22 17:49:06