melonJS icon indicating copy to clipboard operation
melonJS copied to clipboard

Support Gamepads

Open adammw opened this issue 14 years ago • 33 comments

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.

adammw avatar Jan 13 '12 08:01 adammw

I saw that too, I need a gamepad now :)

ghost avatar Jan 26 '12 10:01 ghost

Gamepad API is now a working draft spec: http://www.w3.org/TR/gamepad/

parasyte avatar Sep 10 '12 00:09 parasyte

http://www.gamepadjs.com source : https://github.com/sgraham/gamepad.js/

will do a nice plugin once the plugin system will be ready :)

ghost avatar Sep 24 '12 18:09 ghost

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

ghost avatar Feb 16 '13 15:02 ghost

it's rather old, but I just found the following article : http://constyspace.blogspot.nl/2012/07/gamepadhtml5-websocket.html

ghost avatar Mar 18 '13 04:03 ghost

https://github.com/kallaspriit/HTML5-JavaScript-Gamepad-Controller-Library

obiot avatar Aug 04 '13 03:08 obiot

http://html5gamepad.com/

obiot avatar Oct 03 '13 11:10 obiot

https://wiki.mozilla.org/GamepadAPI#!

aaschmitz avatar Oct 09 '13 02:10 aaschmitz

https://hacks.mozilla.org/2013/12/the-gamepad-api/

obiot avatar Dec 19 '13 17:12 obiot

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.

lunarcloud avatar Jan 13 '14 00:01 lunarcloud

Will be a great addition to melonJS!

aaschmitz avatar Jan 13 '14 00:01 aaschmitz

@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.

parasyte avatar Jan 13 '14 01:01 parasyte

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.

obiot avatar Jan 13 '14 02:01 obiot

So does melonjs support Xbox360 controllers?

uxdxdev avatar Jan 16 '14 17:01 uxdxdev

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

obiot avatar Mar 28 '14 01:03 obiot

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.

agmcleod avatar Mar 28 '14 22:03 agmcleod

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.

parasyte avatar Mar 28 '14 22:03 parasyte

http://gamedevelopment.tutsplus.com/tutorials/using-the-html5-gamepad-api-to-add-controller-support-to-browser-games--cms-21345

aaschmitz avatar Sep 11 '14 13:09 aaschmitz

http://blogs.msdn.com/b/uk_faculty_connection/archive/2014/11/18/internet-explorer-and-xbox-controller-support.aspx

aaschmitz avatar Nov 21 '14 10:11 aaschmitz

parasyte avatar Dec 17 '14 08:12 parasyte