(tip, you can drag and drop the image into snap to get the library)
The gamepads reporter reports the gamepads that it detects. It may not detect the gamepads the first time you run it, but it should the next time.
I created the pov dpad () block because I have a controller that uses an axis for the dpad, and that was the only way I could detect the direction I pressed.
clamp is to normalize joysticks.
deadzone makes an axis (or list of axes) have a deadzone, as well as (hopefully) smooth it.
rumble makes the controller rumble, only if it supports rumble (will probably error if it doesn't, I need to test that).
show analog stick displays 2 axis on stage as an analog stick. This is used in the project to demo the library.
Update: I added a rumble block. Now you can make controllers rumble in your games. I've only been able to test it because I got a Bluetooth adapter for my computer, so now I can use my joycon on my computer.
I also added a global variable to auto import the extension (this only works if you have js enabled, or have a userscript to whitelist my extensions url).
I wish it were too, I mean, it is similar to the robot extensions, but probably more usable since more people have gamepads. Technically all the snap devs need to do is whitelist the extension url, then it'll work without js enabled.
It's a shame there isn't (yet) a good method of allow listing extensions like this
Obviously, you seem to be trustworthy, long time community member but at the moment, only a small number of educational sources are on that list.
I'm lucky , the MQTT extension has been folded into the main libraries but that leads to it's own problems..
If a bug is found, I can't directly patch and fix it and make it available ASAP. It requires me to make a PR and Jens to merge it (which at least gets it into dev version) and then for Jens to make a new release before everyone gets the fix.
Now Jens (hopefully) trusts me and he could allow list one of my GitHub repositories but the problem with that is that it could get hacked by someone. Or I could delete it or I could sneak in another block that doesn't really have anything to do with MQTT
I've been thinking about this issue for a long time but haven't come up with any acceptable, workable method of doing it