genba-games / morsemadness

Transmission team ADKL
https://berith.itch.io/m-m
GNU General Public License v3.0
5 stars 1 forks source link

Gamepad rework #16

Closed berithpy closed 6 years ago

berithpy commented 6 years ago

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.

berithpy commented 6 years ago

Keymap is no longer needed to create our Gamepad object, i should clear those 1 and 0 from operator and dweller.

berithpy commented 6 years ago

Also, the keymap on Gamepad.js is no longer needed, i moved it to a separate file.

AlejoAsd commented 6 years ago

Keyboard gamepads aren't being swapped. #18

AlejoAsd commented 6 years ago

PS4 controller input is not being detected/processed. #20

AlejoAsd commented 6 years ago

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.

berithpy commented 6 years ago

Can't control the second player with keyboard only #23

berithpy commented 6 years ago

I think this is working atleast as good as it was before changing the gamepad object!

AlejoAsd commented 6 years ago

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.