Discuss Scratch

thelegosensei
Scratcher
21 posts

Xbox 360 Controller Support Mod?

bobbybee wrote:

thelegosensei wrote:

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?

thelegosensei wrote:

btw you swapped sin and cos
Are 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?

Jonathan50 wrote:

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?

Thepuzzlegame wrote:

johny5134 wrote:

bobbybee wrote:

…and done!

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!
How exactly do you install this, please reply soon, I really look foward to this
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
Is this the “Inspect Element” console?
Meowswish55
Scratcher
100+ posts

Xbox 360 Controller Support Mod?

Meowswish55 wrote:

Thepuzzlegame wrote:

johny5134 wrote:

bobbybee wrote:

…and done!

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!
How exactly do you install this, please reply soon, I really look foward to this
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
Is this the “Inspect Element” console?
Oh i got it. It's cool!
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?

bobbybee wrote:

…and done!

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!
Does it work for ps4?
Wettining
Scratcher
500+ posts

Xbox 360 Controller Support Mod?

ILuvNintendo wrote:

bobbybee wrote:

…and done!

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!
Does it work for ps4?
no
Braveferry
Scratcher
2 posts

Xbox 360 Controller Support Mod?

the console is saying STOP!
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?

bobbybee wrote:

…and done!

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!
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
maxdadigital
Scratcher
55 posts

Xbox 360 Controller Support Mod?

SewCool wrote:

bobbybee wrote:

…and done!

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!
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
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?

MasterGameGuy1 wrote:

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?

badatprogrammingibe wrote:

MasterGameGuy1 wrote:

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
no, this is a better one: (i'm not saying you have to…)
define life
⋔⟒☌⏃ ⊑⏃☊☍:: #ff9400 cap
right here
badatprogrammingibe
Scratcher
500+ posts

Xbox 360 Controller Support Mod?

maxdadigital wrote:

badatprogrammingibe wrote:

MasterGameGuy1 wrote:

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
no, this is a better one: (i'm not saying you have to…)
define life
⋔⟒☌⏃ ⊑⏃☊☍:: #ff9400 cap
right here
That could be a better choice, but it doesn't work with extensions.
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?

badatprogrammingibe wrote:

MasterGameGuy1 wrote:

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!!
MasterGameGuy1
Scratcher
28 posts

Xbox 360 Controller Support Mod?

define ur mom lol jk
gatoamb
Scratcher
19 posts

Xbox 360 Controller Support Mod?

110Percent wrote:

bobbybee wrote:

…and done!

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!
That took an hour.


The im portant thing is did it work not how long it took. also where do you put the code into?

Powered by DjangoBB