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

#1 2011-01-17 18:37:12

Fluffamun
Scratcher
Registered: 2011-01-17
Posts: 32

Help!

I want to make my Sprite1 follow Sprite2. But I'm pretty new so I need help!  big_smile


Oh, y'know. Madness and such. You read mai post? Thanks. :p

Offline

 

#2 2011-01-17 18:43:12

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Help!

Fluffamun wrote:

I want to make my Sprite1 follow Sprite2. But I'm pretty new so I need help!  big_smile

In what way do you want it to follow it?  You can do:

<when green flag clicked>
<forever>
<go to[ sprite1

for it to go right to it, or:

<when green flag clicked>
<forever>
<point towards( sprite1
<move( 10 )steps>

for constant movement or:

<when green flag clicked>
<forever>
<point towards( sprite1
<move( <distance to[ sprite1/100 )steps>

for a smooth motion.

There are a ton of other ways to do it also, so if these aren't what you're looking for, try working around with different mixes of them.

Last edited by AtomicBawm3 (2011-01-17 18:44:08)


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#3 2011-01-17 20:01:54

kingofdallamas
Scratcher
Registered: 2010-03-07
Posts: 500+

Re: Help!

Yeah, what AtomicBawn has scripted is correct. It's one of the basics if you're not doing platform engines and other things that's not 1D, I think.  smile


http://i853.photobucket.com/albums/ab99/Gilgamesh1192/Ninja%20Saga/ElementalJutsus2.gifhttp://i27.photobucket.com/albums/c192/BoomKaTish/GIF/thgfhgfhfhgf.gif
ハロー友だち!

Offline

 

#4 2011-01-18 16:52:15

WeirdF
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Help!

I always find the forum scripts hard to understand, here's some pictures of different ways of doing it:

Making it follow the sprite, but stopping before it touches it:
http://img824.imageshack.us/img824/9308/21326296.gif

Making it follow the sprite, and it stops when it touches it:
http://img195.imageshack.us/img195/1962/36349138.gif

Making it constantly go to the sprite:
http://img403.imageshack.us/img403/1276/99764133.gif

Fluid motion:
http://img545.imageshack.us/img545/1829/62241662.gif
(Make the number 50 smaller to make it go faster)


http://i.cr3ation.co.uk/dl/s1/gif/847032b8a331def77529b6a0384db1fe_handfingers.gif

Offline

 

Board footer