Hello everybody, I've been working on a 2d sidescroller for awhile now and worked through some pretty difficult bumps in the road, but this one has me stumped, because it has to do with how
Java keybindings work.
Instead of using keyListeners this time around, I read up on key bindings (setup through put() and InputMaps and ActionMaps). Most said they were more used for game controls. And although the process ended up being really similar, and I didn't see any advantage, I stuck with it. Only now I'm having game issues.
One of the most common inputs from the user in a sidescroller is to hold a directional key to move the character left/right, then while still holding it, jump, and continue. Using WASD for moving and SPACE for jumping, the list of keys being pressed during this time looks like this.......AAAAAAAAAAAAAAA*SPACE**SPACE RELEASED*..... The problem is that even though the user is still holding A the whole time, at the end there, after the SPACE press and release, it is no longer recognized without the user releasing A and then pressing it again. This is very impractical to have in a game. So here's the question...
I haven't done a significant amount of figuring out how keyListeners would work in situations like this, so I'm asking before I go to change anything. Would keyListeners have the same issues? Should I switch to them or try something else? Is this a common issue?
Thanks,
Caleb