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.

Author
Message
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 3rd Mar 2003 03:49
since I amde a classic pong, i made it a two player as well. the problem is when the arrow keys are moving, the 2nd player keys(a and d) do not work. how can i stop this?thanx
"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 3rd Mar 2003 10:42
ok the arrowkeys seem to have a press order and I think thats to do with the way windows talks to the keyboard so its out of our hands i think.

to use keys effectively tho disregarding those nasty arrow key problems u can use the keystate command

if keystate(ascii key number) = 1
perform action
endif

u can also perform multiples eg:



if keystate(ascii key number) = 1 and keystate(ascii key number) = 1
perform action
endif


Here is a small sample to see the error with the keyboard arrow keys and obtaining multiple key presses while also displaying the asci code for each key in the top left




indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 3rd Mar 2003 10:43
extra note:


press a and d and the left and right aroow keys in combos

MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 3rd Mar 2003 11:00
If you want to reliablly be able to detect more than 1 keypress at a time, you might like to try my FunctionMapper.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 3rd Mar 2003 14:08
I think Im going to add something to my signature

Oh and Toad has a plugin for that

LOL

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!

Login to post a reply

Server time is: 2024-09-19 23:06:06
Your offset time is: 2024-09-19 23:06:06