This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-06-27 01:42:59

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

World-Connect 360 — connect Xbox 360 controllers to Scratch

This may even work with guitars, drums, steering wheels, etc. It is real, but not stable. It was inspired by Kinect2Scratch. It uses the Xna game framework to capture gamepad changes to Scratch with the sensor value block. You will need the Xna game framework to run this untill I can get the Xna redestributable package installed.
_____________________________
BETA BUILD!!
This is beta, so it may be slow and glitchy. https://dl.dropbox.com/u/79521154/World … 360.ccgame YOU NEED THE XNA GAME FRAMEWORK 4.0 FOR THIS TO WORK! Unpack it and run it. Search for the executable once you have it unpacked in Windows Explorer. I uploaded a sample project to the website. I will put a link to it soon.
__________
In the __ Sensor Value block, there are ONLY three variables. If you are in a blank, new project you need to have remote sensors enabled and run World-Connect 360. The variables are "thumbsticks-left-X", "thumbsticks-left-Y", and "current-device". The thumbsticks ones are, obviously, to get the left thumbstick values. Pushing the thumbstick all the way to the left will be -1 for X, all the way to the right would be 1 for X, and everything in between is a decimal. Like I did in the sample, just multiply the speed you want of the spriteand move it along the axis. The y value for the thumbstick is exactly the same (1 is all the way up, -1 is all the way down). Finally, the "current-device" is the device your using. The default currently is "GamePad", but if you dont have one connected it will use the keyboard instead and the "current-device" will change to keyboard as well. With the keyboard, the arrow keys are used instead of the thumbstick, so left is -1X, up is 1y, right is 1x, and down is -1Y.  Thats pretty much it. More info on my project description. The poject is http://scratch.mit.edu/projects/GP1/2641889
_____________
NEW BUILD!
This one has vibrations and SHOULD run faster. The project link is http://scratch.mit.edu/projects/GP1/2642486, and the download for it is the same as well, https://dl.dropbox.com/u/79521154/World … 360.ccgame. Everything else is exactly the same, except that if you broadcast "controller-vibrate" the controller should vibrate for not very long.

Last edited by GP1 (2012-06-28 23:10:52)


I am currently http://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=imagehttp://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=text and I finally got over 1000 posts.

Offline

 

#2 2012-06-27 02:05:44

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

You got this to work with custom blocks? Cool!  big_smile


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#3 2012-06-27 02:08:00

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

Steering wheel would make a heck of a simulator  tongue

Offline

 

#4 2012-06-27 06:07:44

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

This...is...AWESOME!


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#5 2012-06-27 06:33:54

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

Woah... can you upload a video of you using it? That would be amazing.  big_smile


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#6 2012-06-27 22:18:29

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

Hardmath123 wrote:

Woah... can you upload a video of you using it? That would be amazing.  big_smile

Yup! My computer has been slow lately, and I'm going on vacation soon. I'll do my best before vacation, but if I'm not done i'll let you know (my dad wont let me take my computer along  sad  )
EDIT: and my friend also has all my controllers. Darn. I'll try to get it back, or maybe he can do it.

Last edited by GP1 (2012-06-27 22:20:55)


I am currently http://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=imagehttp://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=text and I finally got over 1000 posts.

Offline

 

#7 2012-06-28 12:59:35

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

BTW, if you read my help thread, and think that I dont have WorldConnect, I do have it but I wasnt using sockets. I was writing an xml file from C# and reading it from Scratch. I'm trying to use sockets because they are faster.


I am currently http://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=imagehttp://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=text and I finally got over 1000 posts.

Offline

 

#8 2012-06-28 16:48:19

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

BETA BUILD!!
This is beta, so it may be slow and glitchy. https://dl.dropbox.com/u/79521154/World … 360.ccgame YOU NEED THE XNA GAME FRAMEWORK 4.0 FOR THIS TO WORK! Unpack it and run it. Search for the executable once you have it unpacked in Windows Explorer. I uploaded a sample project to the website. I will put a link to it soon.
__________
In the __ Sensor Value block, there are ONLY three variables. If you are in a blank, new project you need to have remote sensors enabled and run World-Connect 360. The variables are "thumbsticks-left-X", "thumbsticks-left-Y", and "current-device". The thumbsticks ones are, obviously, to get the left thumbstick values. Pushing the thumbstick all the way to the left will be -1 for X, all the way to the right would be 1 for X, and everything in between is a decimal. Like I did in the sample, just multiply the speed you want of the spriteand move it along the axis. The y value for the thumbstick is exactly the same (1 is all the way up, -1 is all the way down). Finally, the "current-device" is the device your using. The default currently is "GamePad", but if you dont have one connected it will use the keyboard instead and the "current-device" will change to keyboard as well. With the keyboard, the arrow keys are used instead of the thumbstick, so left is -1X, up is 1y, right is 1x, and down is -1Y.  Thats pretty much it. More info on my project description. The poject is http://scratch.mit.edu/projects/GP1/2641889

Last edited by GP1 (2012-06-28 16:58:02)


I am currently http://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=imagehttp://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=text and I finally got over 1000 posts.

Offline

 

#9 2012-06-28 16:58:04

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

Sounds cool! Maybe add features that can report the state of buttons.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#10 2012-06-28 17:01:28

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

bobbybee wrote:

Sounds cool! Maybe add features that can report the state of buttons.

I will. There are a lot of buttons, though. This build is just the first beta build, so obviously I'm not done.


I am currently http://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=imagehttp://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=text and I finally got over 1000 posts.

Offline

 

#11 2012-06-28 17:12:53

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

Well, yeah. Also, I'd suggest to make a framework that can support more devices. Like, mouse, keyboard, and gamepad. Maybe even sockets that would allow to control mobile devices.

And maybe even a broadcast for rumble (that would make it truly awesome)


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#12 2012-06-28 17:47:48

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

bobbybee wrote:

Well, yeah. Also, I'd suggest to make a framework that can support more devices. Like, mouse, keyboard, and gamepad. Maybe even sockets that would allow to control mobile devices.

And maybe even a broadcast for rumble (that would make it truly awesome)

The Xna game framework can get any thing that will work with the Xbox, keyboard, and mouse. Even the Kinect, but there is already Kinect2Scratch. And with rumble broadcast, you mean the vibrations of the controller, correct? THIS IS POSSIBLE! I'll try to add it tonight and make another sample project. You will need a variable named "controller-vibration-duration-milliseconds" and "controller-vibration-strength" so that World-Connect will know how long and strong the vibration will last. Then you would broadcast "controller-vibrate" and it would vibrate!
___________
As for the steering wheels, guitar, drums, etc. you should probably read this. I'll try to do as many as I can, but if I dont have one, then that documentation should help you make it yourself. Not now, obviously, since there are only the left thumbsticks, but later when I have lots of other gamepad inputs in.

Last edited by GP1 (2012-06-28 18:09:01)


I am currently http://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=imagehttp://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=text and I finally got over 1000 posts.

Offline

 

#13 2012-06-28 19:43:35

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

Wow. Its EXTREMELY slow. Hmmm. Maybe I should turn down the FPS to maybe 10 instead of 60. The next version of it will be most likely released tonight, I'm going to add vibrations to it! I got C# to FINALLY read messages. It ends up that some Java code by TRocket was SO close to C# that it works! I only got it to read broadcasts, though. I havent messed around with variables yet.


I am currently http://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=imagehttp://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=text and I finally got over 1000 posts.

Offline

 

#14 2012-06-28 19:50:58

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

GP1 wrote:

bobbybee wrote:

Well, yeah. Also, I'd suggest to make a framework that can support more devices. Like, mouse, keyboard, and gamepad. Maybe even sockets that would allow to control mobile devices.

And maybe even a broadcast for rumble (that would make it truly awesome)

The Xna game framework can get any thing that will work with the Xbox, keyboard, and mouse. Even the Kinect, but there is already Kinect2Scratch. And with rumble broadcast, you mean the vibrations of the controller, correct? THIS IS POSSIBLE! I'll try to add it tonight and make another sample project. You will need a variable named "controller-vibration-duration-milliseconds" and "controller-vibration-strength" so that World-Connect will know how long and strong the vibration will last. Then you would broadcast "controller-vibrate" and it would vibrate!
___________
As for the steering wheels, guitar, drums, etc. you should probably read this. I'll try to do as many as I can, but if I dont have one, then that documentation should help you make it yourself. Not now, obviously, since there are only the left thumbsticks, but later when I have lots of other gamepad inputs in.

Or, you could provide a script (Scratch) that would report the inputs to a series of if-else statements. You just input data into a list (from the docs, o' course), and it would translate it.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#15 2012-06-28 21:49:33

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

bobbybee wrote:

GP1 wrote:

bobbybee wrote:

Well, yeah. Also, I'd suggest to make a framework that can support more devices. Like, mouse, keyboard, and gamepad. Maybe even sockets that would allow to control mobile devices.

And maybe even a broadcast for rumble (that would make it truly awesome)

The Xna game framework can get any thing that will work with the Xbox, keyboard, and mouse. Even the Kinect, but there is already Kinect2Scratch. And with rumble broadcast, you mean the vibrations of the controller, correct? THIS IS POSSIBLE! I'll try to add it tonight and make another sample project. You will need a variable named "controller-vibration-duration-milliseconds" and "controller-vibration-strength" so that World-Connect will know how long and strong the vibration will last. Then you would broadcast "controller-vibrate" and it would vibrate!
___________
As for the steering wheels, guitar, drums, etc. you should probably read this. I'll try to do as many as I can, but if I dont have one, then that documentation should help you make it yourself. Not now, obviously, since there are only the left thumbsticks, but later when I have lots of other gamepad inputs in.

Or, you could provide a script (Scratch) that would report the inputs to a series of if-else statements. You just input data into a list (from the docs, o' course), and it would translate it.

I could. It might slow down Scratch, though. It would be faster in C#.


I am currently http://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=imagehttp://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=text and I finally got over 1000 posts.

Offline

 

#16 2012-06-29 00:36:50

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

I got another build out. More info in the first post, at the top.


I am currently http://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=imagehttp://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=text and I finally got over 1000 posts.

Offline

 

#17 2012-07-20 22:09:27

Pitusky12
Scratcher
Registered: 2011-09-21
Posts: 500+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

Would this work in a mac? If so how? Instructions?


Scratch 2.0 Beta Tester  wink

Offline

 

#18 2012-07-21 01:11:30

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

Pitusky12 wrote:

Would this work in a mac? If so how? Instructions?

AAAAAAAHHHHHHHHHHHHHH!!!!!!!!!!!!! I would need a Mac. A better explination:

Here's the good thing: I am developing this thing in C#. C# can be used to develop programs for Windows, Mac OS X, and Linux. My current method uses the Xna Game Framework, which Microsoft made, so it only works on Windows. However, this is VERY slow, so I am not going to use Xna anymore for this project. It will work faster and MAY work on Linux/Mac OS X (that is if there are drivers for controllers).

Here's the bad thing: Apple is very strict with their operating system. One thing is that you MUST develop programs in a language called Objective-C. I've never messed with it, because you can only develop in Objective-C on a Mac, its no use on anyother OS. Anyway, using C# on a Mac is possible by changing the C# code into Objective-C, then you put it into XCode to build it and release it. XCode is ONLY availabld on a Mac, so there's my problem.

Untill I can get my hands on a Mac or somebody who would be willing to install XCode and Mono and allow me to control their computer to develop it, it wont work. THAT DOESN'T MEAN ITS GOING TO STAY A NO, just I cant right now without a Mac.


I am currently http://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=imagehttp://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=text and I finally got over 1000 posts.

Offline

 

#19 2012-07-21 09:11:03

Pitusky12
Scratcher
Registered: 2011-09-21
Posts: 500+

Re: World-Connect 360 — connect Xbox 360 controllers to Scratch

Oh Okay,Thank You For Replying.


Scratch 2.0 Beta Tester  wink

Offline

 

Board footer