I need help making so I can click on sprites, and the sprite that I clicked on will trigger another sprite to come towards it so I can make the sprite that touches it, cause the sprite that I clicked on to explode, and then restart again. please help.
Offline
cord_thundertree wrote:
I need help making so I can click on sprites, and the sprite that I clicked on will trigger another sprite to come towards it so I can make the sprite that touches it, cause the sprite that I clicked on to explode, and then restart again. please help.
YOu can do this:
First, let's say that you clicked on a sprite:
when [sprite1] clicked//when that sprite is clicked broadcast [out v]//send a message telling the others to appear forever if <touching sprite 2> switch to costume [explosion]//switches to explosion costume wait (1) secs hide//disappears wait (1) secsThen for the other sprite:
when I receive [out v] show repeat (1) if < (distance to) [sprite 2] >[10]//if the distance is more than ten point towards [sprite 1 v] //point towards sprite move (5) steps//move 5 steps toward that sprite
Last edited by joshuaho (2013-05-04 13:58:05)
Offline
joshuaho wrote:
cord_thundertree wrote:
I need help making so I can click on sprites, and the sprite that I clicked on will trigger another sprite to come towards it so I can make the sprite that touches it, cause the sprite that I clicked on to explode, and then restart again. please help.
You can do this:
First, let's say that you clicked on a sprite:when [sprite1 ] clicked//when that sprite is clicked broadcast [out v]//send a message telling the others to appear forever if <touching [sprite 2 v]?> switch to costume [explosion]//switches to explosion costume wait (1) secs hide//disappears wait (1) secs endThen for the other sprite:When I receive [out v] show repeat (1) if <(distance to [sprite 2 v]) > [10]>//if the distance is more than ten point towards [sprite 1 v] //point towards sprite move (5) steps//move 5 steps toward that sprite
Fixed
With respects,
~7734f
Last edited by 7734f (2013-05-04 14:26:27)
Offline