I'll take a look at it, but FOR ME, I have found both the onKeyDown function and Key Listeners get lost easier if you have multiple button presses don't register. I generally don't use listeners for fight games controls.
SOLUTION
To active the Spacebar and direction check, two factors must be true:
A) The spacebar must be pressed
B) kd variable must be true
Since the kd variable is INSTANTLY turned to false, you must press the buttons at the EXACT same time, there is no comfort zone. That means if you delay pressing the Up or Down arrow by even an microsecond, it won't work.
Of course, this is all negated by the fact you can press and hold the arrow keys first and THEN press the SPACEBAR. :rolleyes:
Anyhow, that's why I have a button hold time comparison.
code:
else if (Key.isDown(Key.LEFT) && KeyTime < frameLimit){
KeyTime is how long a directional button has been pressed for.
frameLimit is how many frames until we are sure the user isn't pressing Space + the direction, and just pressing SPACE while walking forward, for instance.
For course, there's a lot more details to be worked out but that's the basics.
-pXw
EDIT: And yes, I'll beta for ya...
