I have two Sprites on stage. I want Sprite 2 to turn 15 degrres when touched by Sprite 1. Sprite 2 has this script:
<if><touching[Sprite 1]<turn cw( 15 )degrees>
My problem is that Sprite 2 does not do anything when touched by Sprite 1. They seem to be on two different layers because one would just sit on top of another when they are moved to the same position on the stage.
If layers is the cause, how do I control the layers? I tried searching in Help and Tutorials but could not find anything on how to control the layers.
Any suggesions?
Offline
add a forever block around the "if" block, then it will keep sensing for the sprite. the script you have will only sense for one fempto second or whatever so it only senses once. hope this helps!
Offline
Does your script look like this?[blocks]
<when green flag clicked>
<forever if> <touching[ sprite1 ]>
<turn cw( 15 )degrees>
<end>
[/blocks]
If so, did you click the green flag?
Hope this helps.
Offline
i think thats what he has
Offline
OK, the <forever if> control did it. Thanks! So the problem was not layer.
But, Sprite 2 is spinning non-stop while touched by Sprite 1 with the <forever if> control. I just want it to turn 15 degrees. How do I do that?
Offline
Then add this:
[blocks]
<when green flag clicked>
<forever if> <touching[ Sprite1
<turn cw( 15 )degrees>
<wait until> <not> <touching[ Sprite1 <-- this
<end>
[/blocks]
Last edited by mathematics (2010-10-18 05:03:23)
Offline