Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gamepad rework #16

Merged
merged 16 commits into from
Feb 10, 2018
Merged

Gamepad rework #16

merged 16 commits into from
Feb 10, 2018

Conversation

berithpy
Copy link
Member

@berithpy berithpy commented Feb 5, 2018

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
Copy link
Member Author

berithpy commented Feb 5, 2018

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

@berithpy
Copy link
Member Author

berithpy commented Feb 5, 2018

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

@AlejoAsd
Copy link
Member

AlejoAsd commented Feb 6, 2018

Keyboard gamepads aren't being swapped. #18

@AlejoAsd
Copy link
Member

AlejoAsd commented Feb 6, 2018

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

Added justPressed helper for controller buttons. Currently missing
support for Keyboard keys and controller axes.
@AlejoAsd
Copy link
Member

AlejoAsd commented Feb 6, 2018

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
Copy link
Member Author

berithpy commented Feb 8, 2018

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

@berithpy
Copy link
Member Author

berithpy commented Feb 8, 2018

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

Improved the `keyPressed` function to use a specific check function for
each type of input.
Changed keymap axes format:
* Axis objects must now define each direction independently.
* Axis object is now an object containing the axis and direction.
* Direction is now included in the game key axis configuration. It
  does not need to be included in the `keyPressed` call anymore.
@AlejoAsd AlejoAsd added this to To do in Gamepad rework via automation Feb 10, 2018
@AlejoAsd
Copy link
Member

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.

@AlejoAsd AlejoAsd closed this Feb 10, 2018
Gamepad rework automation moved this from To do to Done Feb 10, 2018
@AlejoAsd AlejoAsd reopened this Feb 10, 2018
Gamepad rework automation moved this from Done to In progress Feb 10, 2018
@berithpy berithpy merged commit 240abbf into master Feb 10, 2018
Gamepad rework automation moved this from In progress to Done Feb 10, 2018
@berithpy berithpy deleted the gamepad-rework branch February 23, 2018 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants