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

#1 2011-12-14 05:04:48

goutpa
New Scratcher
Registered: 2011-11-25
Posts: 4

Following

Can someone tell me how to make one sprite follow another at the same pace.

Offline

 

#2 2011-12-14 07:17:53

mcpNOVA
Scratcher
Registered: 2011-12-05
Posts: 100+

Re: Following

Just use the same speeds, but i'd make the following one n.5 and making your lead one n,
n being the speed you're using.

Hope this helped!


http://i43.tinypic.com/n5fqcz.jpg

Offline

 

#3 2011-12-14 07:21:01

mcpNOVA
Scratcher
Registered: 2011-12-05
Posts: 100+

Re: Following

Oops, n.5 and 5 are vise-versa, leading one is n.5 and following one is n
Sorry. xD


http://i43.tinypic.com/n5fqcz.jpg

Offline

 

#4 2011-12-14 09:58:12

PaperMario123
Scratcher
Registered: 2011-11-25
Posts: 500+

Re: Following

Well, I've come up with 2 ways:

1) Make the sprite (sprite 2) you want to follow the other sprite (sprite 1) with the same scripts, but make it wait a little before it starts (say, .5 seconds).

2) Male a sprite that blends in with the background, and make it's center point the "back" of the sprite. Then, sort of like using Option 1, make the sprite that blends into the background with the trail it'll take. Meanwhile, have the sprite that you want to follow get a Forever block (or Repeat Until <>, or something) and make it have a "Go to [insert blending-in-with-background sprite name here]," so it'll always go to the "end" of the invisible sprite.

I hope this helps.


http://i.picasion.com/pic46/52268c4a041cced4c8ed97cc7468f869.gif

Offline

 

#5 2011-12-14 18:30:12

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Following

You can also use a list for seamless following.

As the first sprite moves, record all the movement in a list(s).

Then, wait the appropriate amount of time before the second sprite just uses the list coordinates to "go-to", and deleting them as they go.


Hai.

Offline

 

#6 2011-12-15 03:21:29

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Following

If Sprite2 is the one doing the following, then put this on it:

When green flag clicked
Forever
Point towards 'Sprite1'
Move [speed of Sprite1] steps
End forever

Hope this helps!  smile


Why

Offline

 

#7 2011-12-15 03:25:15

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Following

Fg123's method would work as well, though it'd be more complicated.
If you want to see how list coordinates would work, you can download this project and see.


Why

Offline

 

Board footer