Discuss Scratch
- thelegosensei
-
Scratcher
21 posts
Xbox 360 Controller Support Mod?
I tried to make a little dot move around in circles with the joystick, but ultimately couldn't due to how the directional thing works. I couldn't create a diagonal axis using two axis, because it's locked on direction and force. great plugin, but I can't really use it without this ability.
You can compute the components in Scratch as:
X = Force * cos of Direction
Y = Force * sin of Direction
Hope this helps
(The blocks for cos/sin are in Operators, if you haven't used them.)
oh, interesting.
when I tested it before, the
(direction of [left v] stick)was only giving me 0, 90, 180, and -90. but now I see it's all around, so now I can use it! thank you!
btw you swapped sin and cos
- Jonathan50
-
Scratcher
1000+ posts
Xbox 360 Controller Support Mod?
btw you swapped sin and cosAre you sure? I'm pretty certain that's the right way round.
Edit: Oh, wait maybe you're right, because in Scratch 0° is up instead of horizontal… I don't know.
Last edited by Jonathan50 (July 11, 2018 09:15:35)
- bobbybee
-
Scratcher
1000+ posts
Xbox 360 Controller Support Mod?
Edit: Oh, wait maybe you're right, because in Scratch 0° is up instead of horizontal… I don't know.
Hm, yeah,@lego is probably right. See the line that computes the direction:
var value = 180 * Math.atan2(x, y) / Math.PI;
Normally we would use atan2(y, x), of course. Presumably somebody (i?) had a good reason for implementing it in that order, apparently to match Scratch's angle conventions which I have since forgotten

…so yeah, the usual cos/sin ordering is going to be off.
- Meowswish55
-
Scratcher
100+ posts
Xbox 360 Controller Support Mod?
Is this the “Inspect Element” console?Go into the editor, open up the browser console and paste this code in and press enter. Then check the More Blocks section and the blocks should be loaded…and done!How exactly do you install this, please reply soon, I really look foward to this
https://github.com/bobbybee/scratch-gamepad/blob/master/ext.js
Import that as an experimental extension (look around the forums), and it will give you a get axis and get button on _any_ supported controller. You'll need a recent version of Google Chrome, though (since like 22). Once imported, it should show up in more blocks with a yellow circle. Press any button (although in practice, only some will work), and it will turn green. At this point, you're done!
The mappings are: http://www.html5rocks.com/en/tutorials/doodles/gamepad/gamepad_diagram.png
Have fun!
- Meowswish55
-
Scratcher
100+ posts
Xbox 360 Controller Support Mod?
Oh i got it. It's cool!Is this the “Inspect Element” console?Go into the editor, open up the browser console and paste this code in and press enter. Then check the More Blocks section and the blocks should be loaded…and done!How exactly do you install this, please reply soon, I really look foward to this
https://github.com/bobbybee/scratch-gamepad/blob/master/ext.js
Import that as an experimental extension (look around the forums), and it will give you a get axis and get button on _any_ supported controller. You'll need a recent version of Google Chrome, though (since like 22). Once imported, it should show up in more blocks with a yellow circle. Press any button (although in practice, only some will work), and it will turn green. At this point, you're done!
The mappings are: http://www.html5rocks.com/en/tutorials/doodles/gamepad/gamepad_diagram.png
Have fun!
- Meowswish55
-
Scratcher
100+ posts
Xbox 360 Controller Support Mod?
yes
Last edited by Meowswish55 (Aug. 2, 2018 23:42:01)
- ILuvNintendo
-
Scratcher
7 posts
Xbox 360 Controller Support Mod?
…and done!Does it work for ps4?
https://github.com/bobbybee/scratch-gamepad/blob/master/ext.js
Import that as an experimental extension (look around the forums), and it will give you a get axis and get button on _any_ supported controller. You'll need a recent version of Google Chrome, though (since like 22). Once imported, it should show up in more blocks with a yellow circle. Press any button (although in practice, only some will work), and it will turn green. At this point, you're done!
The mappings are: http://www.html5rocks.com/en/tutorials/doodles/gamepad/gamepad_diagram.png
Have fun!
- Wettining
-
Scratcher
500+ posts
Xbox 360 Controller Support Mod?
no…and done!Does it work for ps4?
https://github.com/bobbybee/scratch-gamepad/blob/master/ext.js
Import that as an experimental extension (look around the forums), and it will give you a get axis and get button on _any_ supported controller. You'll need a recent version of Google Chrome, though (since like 22). Once imported, it should show up in more blocks with a yellow circle. Press any button (although in practice, only some will work), and it will turn green. At this point, you're done!
The mappings are: http://www.html5rocks.com/en/tutorials/doodles/gamepad/gamepad_diagram.png
Have fun!
- Braveferry
-
Scratcher
2 posts
Xbox 360 Controller Support Mod?
please reply soon
Last edited by Braveferry (March 9, 2019 08:31:56)
- SewCool
-
Scratcher
100+ posts
Xbox 360 Controller Support Mod?
…and done!WOW. You're awesome >.< I know this is probably a question that everybody else already knows the answer to, but what programming language did you use for that? Is it Javascript? Sorry, I want to learn more about coding but am still kind of starting. Thanks
https://github.com/bobbybee/scratch-gamepad/blob/master/ext.js
Import that as an experimental extension (look around the forums), and it will give you a get axis and get button on _any_ supported controller. You'll need a recent version of Google Chrome, though (since like 22). Once imported, it should show up in more blocks with a yellow circle. Press any button (although in practice, only some will work), and it will turn green. At this point, you're done!
The mappings are: http://www.html5rocks.com/en/tutorials/doodles/gamepad/gamepad_diagram.png
Have fun!

- maxdadigital
-
Scratcher
55 posts
Xbox 360 Controller Support Mod?
…and done!WOW. You're awesome >.< I know this is probably a question that everybody else already knows the answer to, but what programming language did you use for that? Is it Javascript? Sorry, I want to learn more about coding but am still kind of starting. Thanks
https://github.com/bobbybee/scratch-gamepad/blob/master/ext.js
Import that as an experimental extension (look around the forums), and it will give you a get axis and get button on _any_ supported controller. You'll need a recent version of Google Chrome, though (since like 22). Once imported, it should show up in more blocks with a yellow circle. Press any button (although in practice, only some will work), and it will turn green. At this point, you're done!
The mappings are: http://www.html5rocks.com/en/tutorials/doodles/gamepad/gamepad_diagram.png
Have fun!
define yos
meme [yes v]::looks
yos
- MasterGameGuy1
-
Scratcher
28 posts
Xbox 360 Controller Support Mod?
im using this extention and nothing is happening. is this outdated??
- badatprogrammingibe
-
Scratcher
500+ posts
Xbox 360 Controller Support Mod?
im using this extention and nothing is happening. is this outdated??This extension is designed for scratch 2.0 so you will have to use ScratchX: https://scratchx.org/#scratch
- maxdadigital
-
Scratcher
55 posts
Xbox 360 Controller Support Mod?
no, this is a better one: (i'm not saying you have to…)im using this extention and nothing is happening. is this outdated??This extension is designed for scratch 2.0 so you will have to use ScratchX: https://scratchx.org/#scratch
define liferight here
⋔⟒☌⏃ ⊑⏃☊☍:: #ff9400 cap
- badatprogrammingibe
-
Scratcher
500+ posts
Xbox 360 Controller Support Mod?
That could be a better choice, but it doesn't work with extensions.no, this is a better one: (i'm not saying you have to…)im using this extention and nothing is happening. is this outdated??This extension is designed for scratch 2.0 so you will have to use ScratchX: https://scratchx.org/#scratchdefine liferight here
⋔⟒☌⏃ ⊑⏃☊☍:: #ff9400 cap
- MasterGameGuy1
-
Scratcher
28 posts
Xbox 360 Controller Support Mod?
plz, make a 3.0 version. or maybe if your reading this scratch ADD CONTROLLER BLOCKSSSSSSS. Please it would be helpful
- MasterGameGuy1
-
Scratcher
28 posts
Xbox 360 Controller Support Mod?
im using this extension and nothing is happening. is this outdated??This extension is designed for scratch 2.0 so you will have to use ScratchX: https://scratchx.org/#scratch
Thanks! Very helpful!!
- gatoamb
-
Scratcher
19 posts
Xbox 360 Controller Support Mod?
The im portant thing is did it work not how long it took. also where do you put the code into?…and done!That took an hour.
https://github.com/bobbybee/scratch-gamepad/blob/master/ext.js
Import that as an experimental extension (look around the forums), and it will give you a get axis and get button on _any_ supported controller. You'll need a recent version of Google Chrome, though (since like 22). Once imported, it should show up in more blocks with a yellow circle. Press any button (although in practice, only some will work), and it will turn green. At this point, you're done!
The mappings are: http://www.html5rocks.com/en/tutorials/doodles/gamepad/gamepad_diagram.png
Have fun!














