This is really starting to get annoying. It seems to me that keystate assigns some keys a higher priority than others. I'm having problems with this in my current project(A one player, top-down, helo shooter), as well as others. I've checked and rechecked, and each key affects a different variable, and are independent of one another, yet some keys will block the presses of other keys. Is this a problem with DBPro? Or, am I just not getting it?
Here's the code I was using:
control:
if leftkey()=1 then inc lrt#,.14
if rightkey()=1 then inc rrt#,.14
if upkey()=1 then inc fmt#,.3
if downkey()=1 then dec bmt#,.05
return
This code has no problem. But, I need the player to use their right hand for the mouse, and so I need WASD controls.
So, I changed it to this:
control:
if keystate(30)=1 then inc lrt#,.14
if keystate(32)=1 then inc rrt#,.14
if keystate(17)=1 then inc fmt#,.3
if keystate(31)=1 then dec bmt#,.05
return
As you can see, the four function work independently. Yet unlike the leftkey(), upkey(), etc. commands, you can only have one or two pressed, and then the keyboard no longer receives input from any other keys... Is there a better way to detect key presses?
Thanks in advance, ADM.
If life were like a box of chocolates, I'd know what I would get... The one that got dropped on the floor and put back in the box.
Iye nehvur yoose spehl chehk, ahn mie tippyng izz fiyne.