-
Notifications
You must be signed in to change notification settings - Fork 26
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
Conversation
There was a problem hiding this 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.)
addons/block_code/simple_nodes/simple_character/simple_character.gd
Outdated
Show resolved
Hide resolved
addons/block_code/simple_nodes/simple_character/simple_character.gd
Outdated
Show resolved
Hide resolved
addons/block_code/simple_nodes/simple_character/simple_character.gd
Outdated
Show resolved
Hide resolved
addons/block_code/simple_nodes/simple_character/simple_character.gd
Outdated
Show resolved
Hide resolved
thanks for the review @wjt, I just fixed all the changes so it should be ready for re-review now. |
addons/block_code/simple_nodes/simple_character/simple_character.gd
Outdated
Show resolved
Hide resolved
addons/block_code/simple_nodes/simple_character/simple_character.gd
Outdated
Show resolved
Hide resolved
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
fd7db2b
to
34301a1
Compare
There was a problem hiding this 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.
@dsd please can you award the bounty to this 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)