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

Improve multiplayer controls & documentation #13

Merged
merged 4 commits into from
Nov 12, 2024
Merged

Conversation

wjt
Copy link
Member

@wjt wjt commented Nov 12, 2024

Some tweaks having tested out the changes from #9 and #8.

wjt added 4 commits November 12, 2024 10:23
As a joypad user I would never expect to jump with the Up button on the
D-pad. And if you're using the joystick it's easy to accidentally
trigger the vertical axis and jump by mistake.

Remap the controls as follows:

- Rename the player_{1,2}_up actions in the input map to
  player_{1,2}_jump which more accurately reflects the meaning of the
  action.
- Remove the unused player_{1,2}_down actions.
- Map the bottom action button (Sony ×, Xbox A, Nintendo B) of each
  joypad to the corresponding _jump action.
- Unmap the vertical axis of the joystick from each _jump action.

I decided to leave the D-pad Up button in place because it's harder to
trigger accidentally.
Previously, the instructions would remain on the screen until a keyboard
key was pressed.

Now that joypad input is supported, hide the instructions when a joypad
is used, too. There are two different event types to check for:
InputEventJoypadButton for buttons, and InputEventJoypadMotion for
joystick axes with fractional movement.
On an AZERTY keyboard, common in French-speaking areas, the keys
corresponding to the W/A/D positions on a US keyboard are Z/Q/D. On a
Dvorak keyboard, commonly used by nerds who like to make their own lives
more difficult and regret the choice they made 20 years ago, the keys
are ,/A/E.

Add the physical keycodes to the input map. Leave the logical keys in
the map so that pressing the key labelled “W” (documented in the
on-screen instructions) still works.
@wjt wjt requested review from manuq and starnight November 12, 2024 10:50
@wjt wjt mentioned this pull request Nov 12, 2024
Copy link
Contributor

@manuq manuq left a comment

Choose a reason for hiding this comment

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

Oh thanks, I went to bed thinking if the explanation was good enough and planning to not tell Justin how to use it, ask him to follow the instructions instead.

I was unsure when I switched off the physical keys. I saw that builtin "ui_left" is a generic Left arrow, not the physical one. So I blindly followed that. Luckly you have a dvorak keyboard! The joystick button for jumping is better too.

@manuq manuq merged commit 128ef00 into main Nov 12, 2024
1 check passed
@manuq manuq deleted the push-vqmnmrqnzslz branch November 12, 2024 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants