After running tests and creating some demos, the result was GameController.js: a lightweight JS library to simplify the API interface and make it easier to use on web applications and games. Still at an early stage, but fully working.
...But I have a problem: the gamepad I used for testing is a SNES replica that only has 8 buttons and 1 joystick/axe, and the API supports a standard 17-button and 2 joysticks/axes gamepad. So I haven't been able to test the whole functionality 😅
If you have a gamepad/joystick for your computer, please give it a try. Test the demo page below or the ones on github, and let me know what you think. All feedback is welcome.
Demo (you may need to open it on a new page):
- Select button will reset the game
- Start button will start a new game after reset
- Right/Left joystick/buttons to move the paddle