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

Dynamically register gamepads #21

Open
Piturnah opened this issue Jan 18, 2025 · 0 comments
Open

Dynamically register gamepads #21

Piturnah opened this issue Jan 18, 2025 · 0 comments
Labels
good first issue Good for newcomers

Comments

@Piturnah
Copy link
Collaborator

Prior to migrating to 0.15 (#20), we would assign players 3 and 4 to gamepads automatically based on their indexes.

Since 0.15, bevy introduced "gamepads as entities", which improves the API of working with them.

A consequence of this is that gamepads can't just be referenced by a static index anymore (afaik).

So, in #20 we disabled the gamepads entirely as a temporary solution, but it would be good to get them working again.

Since we are still prototyping and don't have a "character select screen (#7)", an appropriate solution is to keep players 1 and 2 on the default keyboard maps, and if a gamepad is plugged in assign it dynamically to player 3, then a subsequent one to player 4. Don't particularly mind what happens with further gamepads after that, for the prototype.

It may be useful to refer to the leafwing input manager example.

@Piturnah Piturnah added the good first issue Good for newcomers label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant