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 / Keyboard commands.

Author
Message
Smurf
21
Years of Service
User Offline
Joined: 26th May 2003
Location:
Posted: 29th May 2003 20:28
to do keyboard commands, would i use INKEY$() command or just plane IMPUT? im trying to make it so W is forward and so forth ...
Dr BOK
21
Years of Service
User Offline
Joined: 8th Feb 2003
Location: United Kingdom
Posted: 29th May 2003 20:56 Edited at: 29th May 2003 21:01
You could use keystate()

E.G
if keystate(17) then move object 1,1

The 17 means the W key.

Here is a good link to all the scancodes for the keyboard keys
http://hometown.aol.com/alp29b/ScanCodes.txt
I cant remember whos site it was but im sure they wont mind me posting it here. Alter the second 1 to change the speed of it.
Good Luck

Flawless Designs
Smurf
21
Years of Service
User Offline
Joined: 26th May 2003
Location:
Posted: 29th May 2003 21:15
Ahh, cool thanks a lot.
Is there like, a list for the key codes that you know of?

Smurf
21
Years of Service
User Offline
Joined: 26th May 2003
Location:
Posted: 29th May 2003 21:17
Oh doh, you gave me on all ready, sorry man, thanks again!

sicjoshsic
21
Years of Service
User Offline
Joined: 8th May 2003
Location: United Kingdom
Posted: 29th May 2003 21:20
i got a little function written up that returns the name of the key you're pressing (useful for key configuration menues) if you want that?

Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 29th May 2003 21:22
If you are doing 2D instead of 3D you could use the code below for movement, alter it to suit your needs Smurf.



I hear and I forget. I see and I remember. I do and I understand.
Dr BOK
21
Years of Service
User Offline
Joined: 8th Feb 2003
Location: United Kingdom
Posted: 29th May 2003 22:02
You're welcome Smurf.

Flawless Designs
Smurf
21
Years of Service
User Offline
Joined: 26th May 2003
Location:
Posted: 30th May 2003 11:12
naw i am doing 3d i like function's ill take a look ast it.

Critters
21
Years of Service
User Offline
Joined: 11th Apr 2003
Location: United Kingdom
Posted: 31st May 2003 16:33
ah right

Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 1st Jun 2003 17:51
It's just basic movement of a sprite, you press left arrowkey it moves left 1, you press the right arrowkey it moves right 1, you get the idea..

I hear and I forget. I see and I remember. I do and I understand.

Login to post a reply

Server time is: 2024-09-20 09:40:48
Your offset time is: 2024-09-20 09:40:48