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

#1 2012-09-02 11:12:25

randomguy200
Scratcher
Registered: 2012-05-28
Posts: 16

Lists help

Does anyone know how (or if) you can use lists to make one sprite exactly follow another?
I know lists can be used to copy what one sprite already did but can they be used to make one sprite follow just behind another without taking short-cuts like this:

when key [space v] pressed
forever
 point towards [sprite1 v]
 move (1) steps
end
Please help!

And thanks in advance  big_smile


http://scratch.mit.edu/static/projects/randomguy200/2757355_sm.png-Check it out  big_smile , go on  cool !

Offline

 

#2 2012-09-02 11:18:50

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Lists help

script for sprite1 (leader)

when gf clicked
delete (all v) of [x list v]
delete (all v) of [y list v]
repeat (5)
add (0 v) to [x list v]
add (0 v) to [y list v]
end
go to x:(0) y:(0)
forever
add (x position) to [x list v]
add (y position) to [y list v]
delete (1 v) of [x list v]
delete (1 v) of [y list v]
script for sprite 2 (follower)
when gf clicked
forever
go to x:(item (1 v) of [x list v]) y:(item (1 v) of [y list v])


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#3 2012-09-02 11:35:07

randomguy200
Scratcher
Registered: 2012-05-28
Posts: 16

Re: Lists help

Thanks  smile

I've never been good with lists!


http://scratch.mit.edu/static/projects/randomguy200/2757355_sm.png-Check it out  big_smile , go on  cool !

Offline

 

Board footer