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.

Newcomers DBPro Corner / Bad movement with qszw buttons

Author
Message
anthonio
16
Years of Service
User Offline
Joined: 21st Jan 2008
Location: Ghent, Belgium
Posted: 21st Jan 2008 16:44
Hi all,

I'm pretty new to DBP.
I followed, read the last 7days tutorials and wrote everything down that I though was important.
So after 7days I began to program my first FPS game.
Everything is running fine but today I bumped into a small problem.
If I use the arrow keys to move around everything is fine.
So if I press left arrowkey and up arrowkey, the screen goes left and up.
I know that when people are playing they prefer to use the q,s,z,w buttons so I changed that and now when I try to press q to go strafe left and z to go up at the same time the screen only goes in 1 direction, either up or either strafe left.

Hope I explained everything well.

notes: I used the syn on and sync rate 0 to prevent lag.
I'll also post my code to move around.



Thanks in advantage.

Windows Vista and Ubuntu 7.10 on Toshiba Satellite L40 - Dual core 1.86Ghz - 1024MB RAM - 120GB HD - ADSL Connection
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 22nd Jan 2008 00:28 Edited at: 22nd Jan 2008 00:30
look into the keystate() and scancode() commands.

inkey$() isn't good for multiple keypresses.

btw, i've never seen "q,s,z,w" movement. WASD, yah, but not QSZW <shrugs>. seems akward to me.

Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP
Dabbler
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 22nd Jan 2008 00:39
Before you have to ask what the scancodes are:

http://forum.thegamecreators.com/?m=forum_view&t=46311&b=1

Hope this helps.


Whatever...
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 22nd Jan 2008 01:09
Yeah, I don't know where you got QSWZ from, WASD is standard.


anthonio
16
Years of Service
User Offline
Joined: 21st Jan 2008
Location: Ghent, Belgium
Posted: 22nd Jan 2008 06:53
thanks guys for the explanation.
LOL, I know what scancodes are, I have read the tutorials
anyway thanks I'm gonna test it right away.

lol gil and virtual nomad, well in america everybody uses WASD, but since I live in belgium (europe) everybody here uses ZQSD.
We have azerty keyboards here not qwerty

Windows Vista and Ubuntu 7.10 on Toshiba Satellite L40 - Dual core 1.86Ghz - 1024MB RAM - 120GB HD - ADSL Connection

Login to post a reply

Server time is: 2024-09-27 10:31:48
Your offset time is: 2024-09-27 10:31:48