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

Added controller support for move block #338

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

urbit-pilled
Copy link
Contributor

/claim #257

I added some Input Actions to the InputMap so that player_1_up contains both keyboard and controller events.
Player 1 and Player 2 joystick buttons are identical aside from belonging to different devices. (Player 1 = Device 0 and Player 2 = Device 1)

Copy link
Member

@wjt wjt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On top of the changes requested below, as mentioned in #337 please fix the linter errors. You can set up and run pre-commit locally as documented in the README.

(For what it's worth, I really don't like how gdformat formats nested dictionaries but that's the price of standardization.)

@urbit-pilled
Copy link
Contributor Author

thanks for the review @wjt, I just fixed all the changes so it should be ready for re-review now.

@urbit-pilled urbit-pilled requested a review from wjt December 16, 2024 21:34
@urbit-pilled urbit-pilled requested a review from wjt December 17, 2024 12:15
@urbit-pilled
Copy link
Contributor Author

Thanks for the review @wjt, I just made the relevant changes, so it should be ready for a re-review now.

Previously, keypresses were detected directly, rather than going through
the input map.

In preparation for handling multiple input devices for each action,
add appropriate entries to the input map at runtime, if not already
present. Map each one to the same key as previously.
Map the d-pad and left stick of controllers 0 and 1 to the directional
actions of players 1 and 2, respectively, in addition to the keyboard
mappings.

Fixes: endlessm#257
@wjt wjt force-pushed the add_controller_support branch from fd7db2b to 34301a1 Compare December 17, 2024 18:36
Copy link
Member

@wjt wjt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great and works in my testing. Thanks for this contribution! I took the liberty of squashing the branch down to two commits: one to rework how keyboard input is handled, and another to add controller input.

@wjt wjt merged commit 52c0f06 into endlessm:main Dec 17, 2024
3 checks passed
@wjt wjt mentioned this pull request Dec 17, 2024
@wjt
Copy link
Member

wjt commented Dec 17, 2024

@dsd please can you award the bounty to this contributor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants