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

#1 2012-07-20 01:26:11

XXtitaniumfangXX
New Scratcher
Registered: 2012-07-12
Posts: 57

how to make a sprite follow another sprite

im not a total newbie, so i know how to do that, but how do i make a sprite go towards where another sprite was when it was fired, and return to a certain point when it hits the edge

Offline

 

#2 2012-07-20 02:59:32

XXtitaniumfangXX
New Scratcher
Registered: 2012-07-12
Posts: 57

Re: how to make a sprite follow another sprite

bump

Offline

 

#3 2012-07-20 06:19:33

Tecklop
Scratcher
Registered: 2009-08-20
Posts: 63

Re: how to make a sprite follow another sprite

http://i924.photobucket.com/albums/ad89/Tecklop/Me.gif


http://neuropod.net/imagehost/uploads/ccd036346f6834ab872b4f233c158c82.png

Offline

 

#4 2012-07-20 14:53:08

XXtitaniumfangXX
New Scratcher
Registered: 2012-07-12
Posts: 57

Re: how to make a sprite follow another sprite

XXtitaniumfangXX wrote:

im not a total newbie, so i know how to do that, but how do i make a sprite go towards where another sprite was when it was fired, and return to a certain point when it hits the edge

i mean how to make a sprite aim at another sprite and just go in a straight line instead of following the other sprite, until it reaches a wall and returns to where it was to fire again

Offline

 

#5 2012-07-20 14:57:15

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: how to make a sprite follow another sprite

XXtitaniumfangXX wrote:

XXtitaniumfangXX wrote:

im not a total newbie, so i know how to do that, but how do i make a sprite go towards where another sprite was when it was fired, and return to a certain point when it hits the edge

i mean how to make a sprite aim at another sprite and just go in a straight line instead of following the other sprite, until it reaches a wall and returns to where it was to fire again

Try this.

when gf clicked
forever
 go to [cannon v]
 repeat until <mouse down?>
  point towards [target v]
 end
 repeat until <<touching [edge v]?> or <touching [target v]?>>
  move (3) steps
 end
 if <touching [target v]?>
  change [points v] by (1)
 end
end


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&amp;display=small

Offline

 

#6 2012-07-20 14:59:43

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

Re: how to make a sprite follow another sprite

when gf clicked
forever
 if <thing that happens>
 point towards [target v]
  repeat until <touching [edge v]?>
  move (10) steps
  end  
 go to [cannon v]
 end

Last edited by berberberber (2012-07-20 15:00:18)


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

Offline

 

#7 2012-07-20 14:59:46

XXtitaniumfangXX
New Scratcher
Registered: 2012-07-12
Posts: 57

Re: how to make a sprite follow another sprite

hm.. a bit off what i was looking for, but now i can make this game 2 player  big_smile D
thx

Offline

 

Board footer