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

#1 2013-03-21 19:10:22

fortmcas
Scratcher
Registered: 2009-07-26
Posts: 48

Following

Can someone give me a script to make one sprite follow just behind another?

Thanks,
Fortmcas

Offline

 

#2 2013-03-21 19:46:55

bullelk12
Scratcher
Registered: 2012-05-26
Posts: 100+

Re: Following

when gf clicked
forever
set x to (([x position v] of [sprite v]) - (20))
set y to ([y position v] of [sprite v])


http://mag.racked.eu/cimage/i6000/Achievement++get%21/Scratcher+love+minecraft%21/mca.png

Offline

 

#3 2013-03-31 16:32:20

shivadas
Scratcher
Registered: 2010-02-06
Posts: 100+

Re: Following

This is how I would do it:

when gf clicked
forever
go to [Leader v]
change x by [-10]
end


Please check out my latest project, Hunger Avenger!

Offline

 

#4 2013-04-01 07:54:24

xlk
Scratcher
Registered: 2013-03-18
Posts: 57

Re: Following

2D follow:

when gf clicked
forever
 point to [sprite to follow]
 move ((distance to [sprite to follow])-[20]) steps
end
The other sugestions will have it follow, always being 10 pxls to the left.
This will make it follow it, by pointing to it and moving untill it's 20 pxls away.

Offline

 

Board footer