The input doesn't recognize that I release the key?
Posted
by
joapet99
on Game Development
See other posts from Game Development
or by joapet99
Published on 2013-11-04T17:57:04Z
Indexed on
2013/11/04
22:16 UTC
Read the original article
Hit count: 204
I'm creating a window (JOptionPane), in response to a collision. However, if the player is holding a key down when the window pops up, the input doesn't trigger a key release when the key is released.
I don't think you can just check it with a isRelease
function in the input, since the input is kind of corrupt. Can you help me?
The way I check if the key is down:
if(input.isKeyDown(Input.KEY_A)&& TestLevel.isFighting == false){
if(owner.canMoveLeft){
position.x -= speed * delta;
}
}
I am not handling the key release by myself, but if I check if the key is down it should work. But it doesn't.
© Game Development or respective owner