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

#1 2012-08-01 20:27:56

destructo-serpent
Scratcher
Registered: 2012-07-25
Posts: 1000+

follow script

how do i make a sprite (s1) follow another sprite (s2) , and if s2 is on the left of s1 then s1 switches to costume1, and vice versa

Offline

 

#2 2012-08-01 22:20:41

destructo-serpent
Scratcher
Registered: 2012-07-25
Posts: 1000+

Re: follow script

bump

Offline

 

#3 2012-08-01 22:27:15

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: follow script

when gf clicked
forever
 point towards [s1 v]
 move (10) steps
 if <((x position) - ([x position v] of [s2 v])) > (0)>
 switch to costume [costume1 v]
 else
 switch to costume [costume2 v]
 end

Last edited by berberberber (2012-08-01 22:48:12)


http://i47.tinypic.com/2iaa73k.png

Offline

 

#4 2012-08-01 22:33:19

destructo-serpent
Scratcher
Registered: 2012-07-25
Posts: 1000+

Re: follow script

thx

Offline

 

#5 2012-08-02 03:21:23

soniku3
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: follow script

destructo-serpent wrote:

thx

In the future please close this topic using the Report button.


internet's all about cats today.

Offline

 

#6 2012-08-02 03:42:08

cheddargirl
Scratch Team
Registered: 2008-09-15
Posts: 1000+

Re: follow script

soniku3 wrote:

destructo-serpent wrote:

thx

In the future please close this topic using the Report button.

But what if the user wants to leave the topic open in case he has more questions about the same scripting problem? There's no need to force someone to close a topic if he/she doesn't want to.


http://i.imgur.com/8QRYx.png
Everything is better when you add a little cheddar, because when you have cheese your life is at ease  smile

Offline

 

Board footer