Controller Support#28
Open
ironcross32 wants to merge 3 commits into
Open
Conversation
…ich lives in the controller-diagnostics group. `uv run controller-diagnostics`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds controller support to the game by way of pygame._sdl2.controller. Bindings are laid out in the readme, in the controller page of the 'how to play' section, and by pressing back/select while driving. This support is hot-pluggable, always grabs onto the first controller it finds, and pauses the game if it loses connection. Rumble support added for certain events like driving on the rumble strip, hazard announcements, and heavy braking. Settings in the gameplay section allow disabling controller support altogether, and disabling rumble.
Hints are expressed in Xbox controller notation. They will be heard if a controller was the last device that was used before the hint fires, otherwise it will be a keyboard hint. This works in the tutorial as well.
The right bumper acts as a modifier or shift button to access a second layer of controls when held down. Just about every feature of the keyboard is supported via controller.