2048
2048 copied to clipboard
Added gamepad support
Added support for gamepad input using the HTML5 Gamepad API (http://www.w3.org/TR/gamepad/). Works on current versions of Google Chrome, Mozilla Firefox, Microsoft Edge and Opera (http://caniuse.com/#feat=gamepad). Doesn’t affect browsers not offering gamepad support.
@iirelu @gabrielecirulli Is anyone taking care of this?
I think problem is that no one has a gamepad to test this.
@sigod Hm… can’t you grab/borrow a cheap USB controller from somewhere? ;) Xbox 360/One and PlayStation controllers work too…!
@chliebel I finally got gamepad...
Care to merge this changes into gh-pages
branch into your fork? So, we will be able to test it on your GitHub Pages. You need to enable this in repository's options.
Sorry for really late response.
@sigod Great news! I merged my changes into my gh-pages
branch and published it. However, I currently don’t have my gamepad with me and won’t be able to check if it works as early as Wednesday.
Does it work for you? Under which circumstances does the TypeError you noted above occur?
Under which circumstances does the TypeError you noted above occur?
After I connect gamepad and press any of ABXY buttons (doesn't react to any of other buttons). After this I get same error on page reload. And need to reopen tab to get it "working".
I noticed that checkButton
accepts 13 as buttonId
and then 15 that's when error occurs. I press only one button.
Hi @sigod, as this PR has its first birthday tomorrow, I think it’s a good time to get this done. ;-) I updated the PR by including a sanity check and pushed a new gh-pages
branch. Could you retest it? Thanks in advance!
PR Birthday? :joy:
@christoga Let’s celebrate. 🎉
Celebrate! 🎉 😂
-
This pull request is 4 years old !! Happy Birthday 🤣