GoogleChromeLabs / proxx

A game of proximity
https://proxx.app
Apache License 2.0
1.31k stars 124 forks source link

Add gamepad support #539

Open lucacasonato opened 2 years ago

lucacasonato commented 2 years ago

This commit adds support for playing PROXX with a gamepad. The gamepad can be used both on the game board, and in the menus. On the game board it can be used to clear (A or LB) or flag (X or RB) tiles, navigate the board using the D-Pad, and switch into alt mode (B). On the menu, A can be used to confirm (Start or Restart) and B can be used to go back or cancel.

I tried to keep this relatively light-weight, but it does add a bit of extra code to the initial bundle (the Gamepad handling specifically). If the user does not use a game pad, the code will not cause any extra CPU usage.

I have tested this on a Steamdeck, and on a Linux machine using an Xbox One controller.

See me trying it out on my Steamdeck here: https://www.youtube.com/watch?v=094whsi4pdw

jakearchibald commented 2 years ago

Thanks for getting this together! I'll review and merge when I get a bit of free time (next week hopefully)