fishfolk / jumpy

Tactical 2D shooter in fishy pixels style. Made with Rust-lang 🦀 and Bevy 🪶
https://fishfolk.org/games/jumpy/
Other
1.65k stars 121 forks source link

feat(input): Allow movement / menu nav with dpad and joystick #991

Closed MaxCWhitehead closed 5 months ago

MaxCWhitehead commented 5 months ago

This adds movement_alt control bindings that default to dpad on gamepad and None on keyboard mappings.

This allows the dpad or joystick to be used to move player and navigate menu. We may not want this if we choose to use dpad for other stuff later, but for now I think this is nice as it avoids player having to remap gamepad controls to use dpad. Menu navigation on joystick is rough as have to flick the joystick repeatedly, dpad is a better experience for me / this came up in feedback too.

Added a helper func to merge both the joystick and dpad input - the movement binding (joystick) is preferred, but if no input it then takes the movement_alt (dpad).

Had a rough time testing this as can't get xbox pro controller 2 to work (probably macOS issue as it's got bad driver support), or gilrs issue. And my PS5 controller crashes (is a gilrs issue) lol. but I tested on steamdeck and this seems to work as intended.

@zicklag @erlend-sh let me know if any concerns with this