JeZxLee Posted October 25, 2015 Share Posted October 25, 2015 Gamepads 100% Firefox, Not Working Chrome? Hi, We are currently working on this HTML5 open-source game here:www.OpenTetris.com We have got 5 USB gamepads working well on Mozilla Firefox but not working well on Google Chrome?The above URL has full source code located on the game's title screen. Gamepad code locations:- "initialize.js" line 118- "screens.js" lines 127 - 129- "input.js" lines 121 - 161 We have a hard deadline of December 1st for Beta1 and need to solve this issue with Chrome & gamepads before it...Any help would be appreciated, thanks! JeZxLee16BitSoft Inc.Video Game Design Studiowww.16BitSoft.com Quote Link to comment Share on other sites More sharing options...
seeker Posted October 25, 2015 Share Posted October 25, 2015 how did you add the video animation (guy at river) at the beginning? very cool the game itself is quite fun. i would prefer a larger playing grid (too narrow) Quote Link to comment Share on other sites More sharing options...
JeZxLee Posted October 25, 2015 Author Share Posted October 25, 2015 how did you add the video animation (guy at river) at the beginning? very cool the game itself is quite fun. i would prefer a larger playing grid (too narrow)Hi, Thanks for playing.The game is 100% open-source.You can download the entire source code on the title screen.(video playing is in "screens.js" - function at 1959) Anyone know what we do wrong with gamepads on Google Chrome?Thanks! P.S. - You are in the game now! (check [About] screen) JeZxLee Quote Link to comment Share on other sites More sharing options...
JazzAceman Posted October 25, 2015 Share Posted October 25, 2015 I can't check your source since I'm reading on a tablet, but I had a similar problem when I was implementing my engine. In contrast to Firefox you have to call “navigator.getGamepads()“ every single frame in Chrome to get a “fresh“ reference to the gamepad objects. You can not simply store and reuse the references since chrome doesn't update the input values on these “old“ objects. Also the timestamp property has a wrong value in Chrome. It also can happen that chrome shows some kind of “ghost“ gamepads, so you should not bank on the provided number of plugged gamepads and therefore you should not automatically map them To the player profiles. Instead you should let the players connect the single gamepads to their single player profiles by pressing a button. This way you can ensure that your players are connected with an actual gamepad device instead of a mysterious ghost device. :-) Quote Link to comment Share on other sites More sharing options...
JeZxLee Posted October 25, 2015 Author Share Posted October 25, 2015 I can't check your source since I'm reading on a tablet, but I had a similar problem when I was implementing my engine. In contrast to Firefox you have to call “navigator.getGamepads()“ every single frame in Chrome to get a “fresh“ reference to the gamepad objects. You can not simply store and reuse the references since chrome doesn't update the input values on these “old“ objects. Also the timestamp property has a wrong value in Chrome. It also can happen that chrome shows some kind of “ghost“ gamepads, so you should not bank on the provided number of plugged gamepads and therefore you should not automatically map them To the player profiles. Instead you should let the players connect the single gamepads to their single player profiles by pressing a button. This way you can ensure that your players are connected with an actual gamepad device instead of a mysterious ghost device. :-)Hi, Thanks for the response.We do check "navigator.getGamepads();" each game frame.Gamepads work 100% on Mozilla Firefox, but not perfectly on Google Chrome. You can download the current source code at below URL link:www.OpenTetris.com(source code download is on title screen on lower-left hand) Gamepad code locations:- "initialize.js" line 118- "screens.js" lines 127 - 129- "input.js" lines 121 - 161 If you can look at our source code later and help us we would appreciated it.Thanks! JeZxLee Quote Link to comment Share on other sites More sharing options...
JeZxLee Posted October 25, 2015 Author Share Posted October 25, 2015 OK.... So the gamepads ARE working on Google Chrome.The issue is that the mapping is incorrect for SOME of my U.S.B. gamepads. Working now on a gamepad custom mapping system.Will post it when it's ready for testing. Thanks! JeZxLee Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.