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

#1 2010-10-17 20:34:24

scratchorange
New Scratcher
Registered: 2010-10-17
Posts: 2

Touching - They don't touch. Please help!

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

 

#2 2010-10-17 20:39:47

pwiter
Scratcher
Registered: 2010-06-02
Posts: 100+

Re: Touching - They don't touch. Please help!

This isn't advanced!


http://i.imgur.com/YBeXc.png

Offline

 

#3 2010-10-17 20:54:29

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Touching - They don't touch. Please help!

This belongs in All About Scratch - almost all Scratch programming questions go there.  smile  I'll move it.

Offline

 

#4 2010-10-17 23:31:16

Tickles
Scratcher
Registered: 2008-11-16
Posts: 49

Re: Touching - They don't touch. Please help!

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!


A fun original puzzle game. The only one of its kind on scratch! Click here!

Offline

 

#5 2010-10-17 23:36:06

nextstorm
Scratcher
Registered: 2009-12-13
Posts: 1000+

Re: Touching - They don't touch. Please help!

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.


bye

Offline

 

#6 2010-10-17 23:44:03

Tickles
Scratcher
Registered: 2008-11-16
Posts: 49

Re: Touching - They don't touch. Please help!

i think thats what he has


A fun original puzzle game. The only one of its kind on scratch! Click here!

Offline

 

#7 2010-10-18 01:36:06

scratchorange
New Scratcher
Registered: 2010-10-17
Posts: 2

Re: Touching - They don't touch. Please help!

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

 

#8 2010-10-18 05:03:01

mathematics
Scratcher
Registered: 2009-03-01
Posts: 1000+

Re: Touching - They don't touch. Please help!

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

 

Board footer