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

#1 2012-02-19 19:52:01

Sammidysam
New Scratcher
Registered: 2011-12-01
Posts: 1

Stop moving when touching this color

I need help with something to stop moving when hitting the red color.  In my scripts for my mutated bug that you hit with fire, it flaps it's wings (switching costumes between bug and bug1), and glides around.  I want it to stop moving and stop flapping wings when it gets hit by the red color. Is it possible to do this?

Sorry, you have to click on the link, I can't use the [img] code yet.

http://i.imgur.com/tsotv.gif

Offline

 

#2 2012-02-19 20:19:13

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Stop moving when touching this color

Well, you're using the glide block.  You can't stop in the middle of that unless you want to stop everything.  If stopping everything is fine, use:

stop all
But otherwise, use a combination of other blocks to substitute and place them in this loop:

if <not <touching color [#FF0000]?>>
your blocks here
end

Last edited by Greenatic (2012-02-19 20:20:03)

Offline

 

#3 2012-02-19 20:30:16

SilverDomination
Scratcher
Registered: 2011-11-23
Posts: 500+

Re: Stop moving when touching this color

Hmm... I think I can help!

when gf clicked
forever
if <touching color [#E01B25]?>
move (0) steps
else
Your Script Here
end
end
Glad I could help!  wink
-SilverDomination


Sooner or Later. Or sooner. Not much, except for a lot. In a way. But it will come no matter what.

Offline

 

#4 2012-02-19 20:42:30

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Stop moving when touching this color

SilverDomination wrote:

Hmm... I think I can help!

when gf clicked
forever
if <touching color [#E01B25]?>
move (0) steps
else
Your Script Here
end
end
Glad I could help!  wink
-SilverDomination

when gf clicked
Repeat Until <touching color [#E01B25]?>
Your Script Here
end

Last edited by MoreGamesNow (2012-02-22 07:38:41)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#5 2012-02-20 11:31:03

PencilFactory
Scratcher
Registered: 2011-11-11
Posts: 100+

Re: Stop moving when touching this color

[scratchblocks]
when gf clicked
forever if <touching color [#00FF57]>
  stop all
end


PencilFactory is http://blocks.scratchr.org/API.php?user=PencilFactory&amp;action=onlineStatus&amp;type=text, see my computerhttp://mag.racked.eu/cimage/i9002/Achievement+get%21/Computer+crashed/mca.png

Offline

 

#6 2012-02-20 11:35:41

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Stop moving when touching this color

PencilFactory wrote:

[scratchblocks] when gf clicked forever if <touching color [#00FF57]> stop all end

You need to put a [/scratchblocks] tag at the end.   smile

when gf clicked
forever if <touching color [#00FF57]>
  stop all
end

Offline

 

#7 2012-02-22 00:52:58

K-Jam
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: Stop moving when touching this color

when gf clicked
forever
if <touching color (red)>
stop script
else

(your script here)
end
end 

Last edited by K-Jam (2012-02-22 00:53:16)


http://images.inmagine.com/img/imagezoo/iz162/Iz162012.jpg COMPASS!!!

Offline

 

#8 2012-02-22 07:38:04

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Stop moving when touching this color

What's with all the "stop all" blocks?  Sammidysam asked for the sprite to stop moving, not for the entire project to stop.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#9 2012-02-22 18:27:15

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Stop moving when touching this color

MoreGamesNow wrote:

What's with all the "stop all" blocks?  Sammidysam asked for the sprite to stop moving, not for the entire project to stop.

That's the only way to stop a gliding sprite (to my knowledge).

Offline

 

#10 2012-02-22 21:08:47

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Stop moving when touching this color

Greenatic wrote:

MoreGamesNow wrote:

What's with all the "stop all" blocks?  Sammidysam asked for the sprite to stop moving, not for the entire project to stop.

That's the only way to stop a gliding sprite (to my knowledge).

Sorry, I misinterpreted "gliding" as simply "moving", mot as moving with the "glide () secs to" block.  My mistake.   smile


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#11 2012-02-22 21:56:01

AlexamonSpace
Scratcher
Registered: 2012-01-20
Posts: 16

Re: Stop moving when touching this color

MoreGamesNow wrote:

SilverDomination wrote:

Hmm... I think I can help!

when gf clicked
forever
if <touching color [#E01B25]?>
move (0) steps
else
Your Script Here
end
end
Glad I could help!  wink
-SilverDomination

when gf clicked
Repeat Until <touching color [#E01B25]?>
Your Script Here
end

GOOD IDEA!!! IM GONNA USE THAT!!!


http://alexamonspace.webs.com/logo.png<----->http://www.lxshare.com/vi-BPqfwA.png
-Alexamon at http://alexamonspace.webs.com/

Offline

 

Board footer