Closed berithpy closed 6 years ago
Keymap is no longer needed to create our Gamepad object, i should clear those 1 and 0 from operator and dweller.
Also, the keymap on Gamepad.js is no longer needed, i moved it to a separate file.
Keyboard gamepads aren't being swapped. #18
PS4 controller input is not being detected/processed. #20
I refactored most of the classes in gamepadConfig
to make it simpler to find keymaps.
I've also added the keyJustPressed
helper method for controller buttons to Gamepad
. The operator is currently setup to use this method. Keyboard keys and axes aren't supported yet however. I've set up issues #21 and #22 for this.
I believe we should be splitting keymap buttons into buttons
and keys
to make sure there are no issues with overlapping codes (as with ENTER
and BUTTON_13
). I'd like some input on this.
Can't control the second player with keyboard only #23
I think this is working atleast as good as it was before changing the gamepad object!
I've included the changes to the new keymap format and added keyJustPressed
support for gamepad buttons and axes. Both Dweller
and Operator
classes are using the corresponding methods to check for input.
I believe the rework is done. If my latest commits are reviewed and approved we can merge this PR.
It needs some more love/cleanup, looking for feedback, there's an issue for when you disconnect a pad and connect a different pad we should handle that somehow.