Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gamepad support, multiplayer considerations? #113

Open
zatch opened this issue Jun 5, 2014 · 3 comments
Open

Gamepad support, multiplayer considerations? #113

zatch opened this issue Jun 5, 2014 · 3 comments

Comments

@zatch
Copy link

zatch commented Jun 5, 2014

Hey there,

Just wondering if you've spent any time working with the Gamepad API, now that it's in live builds of Chrome and Firefox... I whipped up something to add support myself, but it's far from perfect at this point. Xbox 360 support only, but that would be easy enough to change. Feel free to check it out on my fork: https://github.com/zatch/jaws

Criticisms and enhancements appreciated!

-Zatch

@brenopolanski
Copy link

Hi @zatch.

Great feature ✌️

You could create a simple demo?

Bye! :)

@zatch
Copy link
Author

zatch commented Jun 5, 2014

@brenopolanski I'm honestly not sure if I'm going overkill on the math I'm doing in jaws.gamepadReadJoystick, so I don't feel quite ready to build a formal demo page yet. I'd prefer to actually know what I'm talking about before I write up documentation/notes. ;)

In the meantime, you can check out the work-in-progress game I'm working on with @suicidepills. It has pressure-sensitive joystick support for movement (left analog), as well as for drawing a vector that will eventually represent attacks (right analog).

Game progress as of this moment:
http://zandadev.com/zach/hack-n-slash-sprint/gamepad-early-demo/

You can see how I'm implementing the gamepad joysticks at:
lines 99-122: http://zandadev.com/zach/hack-n-slash-sprint/gamepad-early-demo/js/entities/player-factory.js
lines 67-91: http://zandadev.com/zach/hack-n-slash-sprint/gamepad-early-demo/js/entities/character-factory.js

Let me know if you have any questions! Or, if you're better at physics than I am, if you have any suggestions!

-Zatch

Disclaimer 1: Current game sprites are borrowed from Final Fantasy 4.
Disclaimer 2: Chrome is pretty fickle about detecting gamepads... You have to be holding down a button on your gamepad when you refresh the page. Something to do with gamepad signatures...blah blah blah...something else I don't understand.

@brenopolanski
Copy link

@zatch... I will test your code and the send to you my suggestions.

Bye! :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants