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 / I'm having problems with my movement setup.

Author
Message
Carsten
18
Years of Service
User Offline
Joined: 12th Oct 2005
Location:
Posted: 14th Oct 2005 01:12
I made my character move pretty good, but I can only use one setup

Y'know Upkey = Forwards
Downkey = Backwards
Rightkey = Moves Right
Leftkey = Left!

But I want the wasd setup, and I dont know how to do it, I mean... I cant just replace the Upkey with... Wkey.

I'd really like it if somebody could help me with this.
UFO
18
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 14th Oct 2005 14:41
Use the Inkey$() command.
If Inkey$() = "w" then ...
If Inkey$() = "s" then ...
...
Go to the comand help and click on input. Go down untill you find Inkey$() and it will tell you the syntax.
Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 17th Oct 2005 02:26
I'd use keystate

I R tEh Antid0te! ROOOAAAR!
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 17th Oct 2005 06:53
And I'd use Scancode(), so take you pick!

TDK_Man

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 17th Oct 2005 07:18
Quote: "And I'd use Scancode(), so take you pick!"


Keystate is a lot better. If you try to hit two keys at once with scancode() it will only register the lowest numbered key.
Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 17th Oct 2005 20:00
Never use inkey$() either because inkey$ is a variable and can therefore only take in one value at a time making it so you cant move diagnolly.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 17th Oct 2005 20:41
Quote: "If you try to hit two keys at once with scancode() it will only register the lowest numbered key."


Very true. I use Scancode() for like the fire key, but usually with the cursor keys for movement. In such cases, ScanCode() will work at the same time as the arrow keys.

Missed the bit about wanting WASD for control - in which case ScanCode() wouldn't be suitable.

TDK_Man

Yamman
19
Years of Service
User Offline
Joined: 11th Jun 2005
Location:
Posted: 17th Oct 2005 21:00
key state seems the easiest and best. Its what I use. Then again im a newbie myself.

Login to post a reply

Server time is: 2024-09-24 07:28:04
Your offset time is: 2024-09-24 07:28:04