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

#1 2012-01-09 20:11:06

furbyman
Scratcher
Registered: 2010-04-04
Posts: 6

Scripts for attaching sprites

I would like to make a game where you control a sprite that moves over to other sprites which then stick on to it and move with it (a bit like katamari damacy). Can anyone show me some scripts that would be helpful to attach sprites to other sprites? thanks XD


Ninja are cool!
So are bananas!

Offline

 

#2 2012-01-09 20:38:19

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Scripts for attaching sprites

This script will keep the sprite in the same place relative to the first sprite's position:
http://img811.imageshack.us/img811/6850/script.gif


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#3 2012-01-09 20:46:24

furbyman
Scratcher
Registered: 2010-04-04
Posts: 6

Re: Scripts for attaching sprites

Thanks! I'll test that and see how it goes.
[blocks]<play sound[[/blocks]Happiness


Ninja are cool!
So are bananas!

Offline

 

#4 2012-01-09 23:18:59

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Scripts for attaching sprites

However, since Katamari rolls, it'll be kind of hard... I think Kileymeister's script is the best way, even though it does not roll.

Offline

 

#5 2012-01-09 23:41:03

furbyman
Scratcher
Registered: 2010-04-04
Posts: 6

Re: Scripts for attaching sprites

Yeah, and it takes a lot of scripting to let the stuck things stick to other things too, which is what I need. Improvements anyone?


Ninja are cool!
So are bananas!

Offline

 

#6 2012-01-09 23:46:02

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Scripts for attaching sprites

It's really hard to program something like this in scratch though... I'm not sure how you would do this but maybe some more advanced person might know.

Offline

 

#7 2012-01-10 14:43:12

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Scripts for attaching sprites

kayybee wrote:

However, since Katamari rolls, it'll be kind of hard... I think Kileymeister's script is the best way, even though it does not roll.

I could make it roll too if that's what he needs.  To get several to stick to any other object is just going to require plenty "if" blocks, I'm afraid.  There probably is an easier method but I can't think of one.
This one takes rolling to account but I think it may glitch out in semi-rare cases.  I tried it several times and it didn't glitch, but I am suspicious.
http://img855.imageshack.us/img855/6850/script.gif

Last edited by Kileymeister (2012-01-10 14:52:23)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

Board footer