Support Gamepads
Gamepad API http://dvcs.w3.org/hg/webevents/raw-file/default/gamepad.html So far has been implemented in Chrome Canary on all platforms (Windows is XBox 360 controller only). Would be really good for platform games.
I saw that too, I need a gamepad now :)
Gamepad API is now a working draft spec: http://www.w3.org/TR/gamepad/
http://www.gamepadjs.com source : https://github.com/sgraham/gamepad.js/
will do a nice plugin once the plugin system will be ready :)
fyi, there is this game made in the context of the GGJ 2013, i did not really look at it yet, but it uses the gamepad api http://globalgamejam.org/2013/befestigen
it's rather old, but I just found the following article : http://constyspace.blogspot.nl/2012/07/gamepadhtml5-websocket.html
https://github.com/kallaspriit/HTML5-JavaScript-Gamepad-Controller-Library
http://html5gamepad.com/
https://wiki.mozilla.org/GamepadAPI#!
https://hacks.mozilla.org/2013/12/the-gamepad-api/
I'd love to fork and adapt this to your engine instead, as I wasn't happy with ImpactJS. https://github.com/lunarcloud/gamepad.js
I'm just still learning about your engine, and you don't abstract key presses behind "actions" like they do, so it doesn't look as easy to just make it a plugin that flawlessly adds to any game already written.
Will be a great addition to melonJS!
@lunarcloud There is some key press abstraction through key bindings. For exmaple, it is possible to bind multiple keys to a defined action, and even binding click/touch to the same action.
that would be awesome !
I actually quickly through the code and I think that it could be easily ported like in a day. I would however probably move some of the detection stuff into our me.device class and probably add there as well a proper polyfil to avoid calling all the webit/Moz prefixed ones in your code.
So does melonjs support Xbox360 controllers?
while looking for audio fix when using cocoonjs through google, I stumbled on the following : http://videlais.com/2014/02/19/the-trials-and-slow-successes-of-html5-development-using-cocoonjs-on-the-ouya/ https://gist.github.com/videlais/8110000
Hmm. This is kind of where I hope things like the built in web view for iOS and the tools for android get better and support more features that we get in browsers.
I actually started working on this a while ago, but I stopped almost immediately when I learned Firefox does not support gamepad button press events; it requires polling, which as the common denominator means we have to implement gamepad support with polling if we want to support Firefox.
I think I would go back into this ticket thinking we won't care about the deprecated gamepad polling API, and just do it right.
http://gamedevelopment.tutsplus.com/tutorials/using-the-html5-gamepad-api-to-add-controller-support-to-browser-games--cms-21345
http://blogs.msdn.com/b/uk_faculty_connection/archive/2014/11/18/internet-explorer-and-xbox-controller-support.aspx
- Xbox 360 doesn't use bluetooth (fail)
- Firefox does not have standard button mappings for PS3 controllers
- Chrome has a bug that causes gamepads to stop working until the browser is restarted
- Ouya controller on Mac is really messed up until a dummy driver installed: https://github.com/melonjs/melonJS/issues/220#issuecomment-28940804 And the L2 trigger is kind of broken...