Open Kenny2github opened 5 years ago
Do you know any examples of websites that currently take analog controller input? Could be interesting to see how they're doing it. It's unclear to me exactly how that input would appear to the browser; as opposed to binary keypresses, which can just work like keyboard presses.
There's a JavaScript Gamepad API which in retrospect I should have based my proposal off of.
This website is a good sandbox for what controllers report what values.
Some kind of touch input control would be very welcome, supporting multi touch for game pad style input.
On Sun, 21 Apr 2019, 06:03 Ken, notifications@github.com wrote:
There's a JavaScript Gamepad API https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API which in retrospect I should have based my proposal off of.
This https://html5gamepad.com/ website is a good sandbox for what controllers report what values.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/LLK/scratch-vm/issues/2128#issuecomment-485225175, or mute the thread https://github.com/notifications/unsubscribe-auth/ABTM3PVPGSL3HZSYTPEFDK3PRPYQVANCNFSM4HHI7ZJA .
@Kenny2github Safari is not on the list so it's hard to implement.
According to Can I use, Gamepad API has been supported by Safari as well. I just verified an example at the website that DualShock4 works in Safari as expected including analog inputs.
Rationale
Many projects (such as platformers, shooters, or rhythm games) would benefit from using game controller inputs.
Proposal
Here is a rough draft of a set of blocks that could make use of controllers, mostly based off of Pygame's "joystick" framework.