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

#1 2009-04-25 15:28:25

ManaUser
Scratcher
Registered: 2009-03-11
Posts: 100+

JoyTail - Use a joystick with scratch

JoyTail is an experimental program I made that lets you connect a joystick to scratch. I know I'm not the first to make something like this, but this one is a little different. Instead of emulating key presses it uses the Remote Sensor interface to send joystick input directly to Scratch.

You can download JoyTail itself here. It's an exe, so you don't need any extra software to use it. But I included the source code too, in case you don't trust the exe or you want to modify it. It's written in a language called AutoHotkey (which I highly recommend, by the way.)

Here's sample project using it. A complete game is now available too.

Last edited by ManaUser (2009-04-29 01:46:40)


http://i.imgur.com/SPYSM.gif http://i.imgur.com/t9k1Z.gif http://i.imgur.com/OwYVa.gif http://i.imgur.com/0qlZq.gif

Offline

 

#2 2009-04-25 19:16:00

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: JoyTail - Use a joystick with scratch

Looks like a nifty utility - thanks for sharing! 

I'm very interested in the AutoHotKey language you mentioned...it sounds like it could definately make me more productive.  Thanks for that too.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2009-04-27 10:27:02

chalkmarrow
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: JoyTail - Use a joystick with scratch

ManaUser wrote:

JoyTail is an experimental program I made that lets you connect a joystick to scratch. I know I'm not the first to make something like this, but this one is a little different. Instead of emulating key presses it uses the Remote Sensor interface to send joystick input directly to Scratch.

You can download JoyTail itself here. It's an exe, so you don't need any extra software to use it. But I included the source code too, in case you don't trust the exe or you want to modify it. It's written in a language called AutoHotkey (which I highly recommend, by the way.)

Here's sample project using it. I'll have a complete game that uses it to post soon.

Wow. Really nice. I didn't know that AutoHotkey was that powerful. You should put this on the scratchconnections.wik.is site.

Offline

 

#4 2009-04-27 15:20:30

ManaUser
Scratcher
Registered: 2009-03-11
Posts: 100+

Re: JoyTail - Use a joystick with scratch

Thanks (both of you). And yes, AutoHotkey is pretty nifty. The secret in this case is that it can call functions from DLLs, so really you can do just about anything with it that you can do with another Windows programing language. Still I wouldn't claim it's good language for doing networking stuff, it was a pain to get that part set up, even working from an example, and it's still kind of rough. It does have native joystick support though, so it kind of evened out. Where it really shines is as a macro language (hence the name) but it's fun that you can do much more with it if you want.

And yes, I'll see about adding JoyTail to that wiki. I want to finish this game I made to go with it first. (Originally this was just going to be a demo, but I decided it was pretty fun and deserved more work put into it, so made that simple demo instead.)


http://i.imgur.com/SPYSM.gif http://i.imgur.com/t9k1Z.gif http://i.imgur.com/OwYVa.gif http://i.imgur.com/0qlZq.gif

Offline

 

#5 2009-04-29 01:43:50

ManaUser
Scratcher
Registered: 2009-03-11
Posts: 100+

Re: JoyTail - Use a joystick with scratch

Alright. I've got a full game uploaded. It's called Shadow Rocks and it's basically an Asteroids clone, but I think it plays very nicely.

It also shows off a "secret" feature of JoyTail which lets it save a variable even if you don't save the project. I used this to keep a high score.

By the way, the game only uses the X-axis and Y-axis on the joystick and up to ten buttons (with only two really needed), but the demo I posted earlier supports 32 buttons and six axes. So if anybody has a really fancy joystick I'd especially appreciate it if you tested it, because mine doesn't have that many so I can't test it completely.


http://i.imgur.com/SPYSM.gif http://i.imgur.com/t9k1Z.gif http://i.imgur.com/OwYVa.gif http://i.imgur.com/0qlZq.gif

Offline

 

#6 2009-06-03 06:30:52

abee
Scratcher
Registered: 2007-05-25
Posts: 100+

Re: JoyTail - Use a joystick with scratch

Hi, ManaUser.
Great work! It works fine on my Classmate PC.
Typical game controller is more cheaper than other input device such as Pico Board. Cheapest one is sold under $3 in Japan. So we can disassemble to get many input buttons. It's an interesting curriculum for scratch workshop.

BTW, I did another hack for supporting joystick for Scratch.
http://squeakland.jp/abee/tmp/ScratchJoystick.zip
Put ScratchJoystick.image and ScratchJoystick.changes into the same folder of Scratch.image and drag ScratchJoystick.image on Scratch.exe.
joystickTest.sb shows how to use it.
I  wrote it in Smalltalk with ScratchSource1.3.1.

Cheers,
Kazuhiro Abe

Offline

 

#7 2009-10-10 18:02:11

Galacticfuzz
Scratcher
Registered: 2009-09-11
Posts: 9

Re: JoyTail - Use a joystick with scratch

I Dont Know How To Use It

Offline

 

#8 2009-10-18 10:29:29

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Re: JoyTail - Use a joystick with scratch

Galacticfuzz wrote:

I Dont Know How To Use It

same here. how do you put it in scratch? and also, do you need to download autohotkey to make it work?

Last edited by 16Skittles (2009-10-18 10:31:09)


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

#9 2009-10-19 16:12:58

martianshark
Scratcher
Registered: 2008-03-24
Posts: 1000+

Re: JoyTail - Use a joystick with scratch

I tried your game, but it didn't work.


http://img.geocaching.com/stats/img.aspx?txt=martianshark&uid=e6cdc2c8-2476-4abd-9994-27f857396579&bg=1

Offline

 

#10 2009-12-07 23:04:23

martianshark
Scratcher
Registered: 2008-03-24
Posts: 1000+

Re: JoyTail - Use a joystick with scratch

I found out it didn't work because I didn't download JoyTail.  roll

JoyTail is awesome, but could you make it support some other joystick things, such as slider, Z rotation, and point-of-view hat?


http://img.geocaching.com/stats/img.aspx?txt=martianshark&uid=e6cdc2c8-2476-4abd-9994-27f857396579&bg=1

Offline

 

#11 2010-07-02 17:59:15

RocksAndFire
Scratcher
Registered: 2010-04-17
Posts: 1000+

Re: JoyTail - Use a joystick with scratch

I have a mac...

Offline

 

#12 2010-07-28 08:35:55

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Re: JoyTail - Use a joystick with scratch

how did you two even find this topic?


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

#13 2010-07-31 19:33:59

Hawkeye99
Scratcher
Registered: 2010-03-15
Posts: 2

Re: JoyTail - Use a joystick with scratch

I'm trying to make my own game with the joystick but i can't get the joy X and Y sensor values do you need to make your own block or what

Offline

 

#14 2010-07-31 20:26:14

Hawkeye99
Scratcher
Registered: 2010-03-15
Posts: 2

Re: JoyTail - Use a joystick with scratch

Never mind I got it. I just used the sensor values that was on Shadow rocks!

Offline

 

#15 2010-08-07 18:07:11

Mcsugarface
Scratcher
Registered: 2009-11-16
Posts: 100+

Re: JoyTail - Use a joystick with scratch

Do you know the website?


Hi! I'm http://blocks.scratchr.org/API.php?user=USERNAMEHERE&action=onlineStatus&type=text!
http://internetometer.com/imagesmall/11070.png

Offline

 

#16 2010-11-22 13:26:11

ajg29
Scratcher
Registered: 2009-04-25
Posts: 23

Re: JoyTail - Use a joystick with scratch

ManaUser wrote:

JoyTail is an experimental program I made that lets you connect a joystick to scratch. I know I'm not the first to make something like this, but this one is a little different. Instead of emulating key presses it uses the Remote Sensor interface to send joystick input directly to Scratch.

You can download JoyTail itself here. It's an exe, so you don't need any extra software to use it. But I included the source code too, in case you don't trust the exe or you want to modify it. It's written in a language called AutoHotkey (which I highly recommend, by the way.)

Here's sample project using it. A complete game is now available too.

When I tried downloading AutoHotkey, it warned me that it contains unsafe programming. Has anything happened to your computer that has AutoHotkey?

Last edited by ajg29 (2011-02-21 13:16:29)

Offline

 

#17 2010-12-11 13:49:49

BulboGrubb
Scratcher
Registered: 2010-02-19
Posts: 18

Re: JoyTail - Use a joystick with scratch

Also... What kind of joystick do you need...  hmm  I have some old things that used to work on those 'PlugN'Play TV games if you know the sort...  tongue  Would that do the trick?  hmm

Offline

 

#18 2010-12-11 17:37:07

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: JoyTail - Use a joystick with scratch

Hi Bulbo  big_smile

I'd imagine that almost any joystick would work... you could simply try it out with your joystick.  tongue


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#19 2010-12-11 18:18:35

BulboGrubb
Scratcher
Registered: 2010-02-19
Posts: 18

Re: JoyTail - Use a joystick with scratch

Okay.... Will do!  wink  But I still don't really understand all this extra code needed for the sensory blocks...  hmm

Offline

 

#20 2011-01-22 15:50:02

ajg29
Scratcher
Registered: 2009-04-25
Posts: 23

Re: JoyTail - Use a joystick with scratch

BulboGrubb wrote:

Also... What kind of joystick do you need...  hmm  I have some old things that used to work on those 'PlugN'Play TV games if you know the sort...  tongue  Would that do the trick?  hmm

No. It needs to be a joystick that is designed to be used on a PC(like a USB joystick)  smile

Offline

 

#21 2011-02-12 17:30:05

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Re: JoyTail - Use a joystick with scratch

how do people keep finding these topics? over the nearly 1 year it's been open, it only has, like 20 posts. this should be closed, too much necroposting.


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

#22 2011-02-21 13:11:54

ajg29
Scratcher
Registered: 2009-04-25
Posts: 23

Re: JoyTail - Use a joystick with scratch

Hey, can I borrow your source code for my Scratch extension called 'Scratch Sensor Values?' I promise 2 give credit  wink

Offline

 

#23 2011-02-21 13:13:01

ajg29
Scratcher
Registered: 2009-04-25
Posts: 23

Re: JoyTail - Use a joystick with scratch

Jonathanpb wrote:

Hi Bulbo  big_smile

I'd imagine that almost any joystick would work... you could simply try it out with your joystick.  tongue

nope, it has to be a joystick designed to work with a PC  sad  Sorry!

Offline

 

#24 2011-02-21 13:15:39

ajg29
Scratcher
Registered: 2009-04-25
Posts: 23

Re: JoyTail - Use a joystick with scratch

martianshark wrote:

I found out it didn't work because I didn't download JoyTail.  roll

JoyTail is awesome, but could you make it support some other joystick things, such as slider, Z rotation, and point-of-view hat?

It does already. Z rotation is equivalent to the R axis.  wink  POV is Point-Of-View hat.

Offline

 

#25 2011-03-29 23:11:48

jamalaron
Scratcher
Registered: 2010-08-16
Posts: 37

Re: JoyTail - Use a joystick with scratch

my compsint is it dosent work for mac i think scratch should like make somthing like the nes controler


>enter forum
it is dark and the forum is lively you are likely to be eaten by a philistine

Offline

 

Board footer