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 / Using w,a,s,d i FPS

Author
Message
doffer
21
Years of Service
User Offline
Joined: 21st Nov 2003
Location:
Posted: 17th Sep 2004 05:06
Hi, im like so many others, trying to make a little FPS.
But the up/down/left/right- key moving system is a little out of date, and I would like to use w,a,s,d instead.
But how do i do that, if we say:

if upkey()=1 then move object 1,10

Could someone please tell me what to write instead of Upkey, if i whant the "a" key.

Thanks...

Denmark Denmark Denmark.
Pricey
22
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 17th Sep 2004 05:18
Search on google for the scan codes i'm not sure what they are and then use this:

Quote: "If keystate(scancode for the letter a) then move camera 1"




Dot Merix
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 17th Sep 2004 13:16 Edited at: 17th Sep 2004 13:18
You might be able to do it something like this...



If you want it to constantly check what key is being pressed you just have to take out the wait key statements.

Hope this helps ya

- Merix
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 17th Sep 2004 13:21
www.asciitable.com

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 18th Sep 2004 07:25
Or just run the example code provided in DB Classic called input6.dba. I use it to figure out which keys have which scancodes. Then you do this:

if keystate(#)=1 then move object 1,10

Replace # with the scancode number that you want.

Xander Moser - Bolt Software - Firewall

Login to post a reply

Server time is: 2025-05-24 17:35:00
Your offset time is: 2025-05-24 17:35:00