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
19
Years of Service
User Offline
Joined: 12th Oct 2005
Location:
Posted: 14th Oct 2005 01:27
I posted this earlier but it dident show up, and if it did for everyone else, sorry for posting it again

_________________________________________________________________


I got my character to move with my keys but I want a differant stup and I dont know how to change it, I want the wasd setup, But I cant just replace the Upkey with "Wkey"
OR replace the "Downkey" with "Skey"

I'd really like it if somebody could help me with this.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 14th Oct 2005 04:10
You should seriously learn about the search function it'd help a lot, but anyways...

Keystate is what youre looking for, it uses scancodes to locate keypresses. Scancodes are codes given to each key on the keyboard, for example:

W = 17
A = 30
S = 31
D = 32

Having the scancode lets you use keystate to do something like so:



Replace the printing with the movement code. Here's a good reference for scancodes, forget who its created by but anyways:



Think it might have been CR that made that gem.


UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 14th Oct 2005 14:44
You could also use Inkey$(). Check your other thread.
Carsten
19
Years of Service
User Offline
Joined: 12th Oct 2005
Location:
Posted: 14th Oct 2005 17:33
Thank you!
Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 15th Oct 2005 23:35
I use inkey$() mainly because I found it in the help files before I found keystate. Example would be.

inkey$() = "<insert character here>" = ...

I'm pretty sure that keystate is better since inkey$() is a variable and only one button can be pressed at a time with it.

I R tEh Antid0te! ROOOAAAR!
UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 16th Oct 2005 01:44
Oh, yea. It is better that way.

Carsten
19
Years of Service
User Offline
Joined: 12th Oct 2005
Location:
Posted: 4th Nov 2005 17:07
Help files? Search function? Yeah... I bet knowing about those WOULD help alot... But I DONT know about them.
Carsten
19
Years of Service
User Offline
Joined: 12th Oct 2005
Location:
Posted: 9th Nov 2005 18:38
Thanks everyone, figured out about the... Well, help files, its workin' great with Keystate, AND the arrow keys both at the same time, I'm very pleased, thanks again for the help!

Login to post a reply

Server time is: 2024-11-27 14:38:23
Your offset time is: 2024-11-27 14:38:23