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

#1 2012-03-12 09:02:44

suchak
New Scratcher
Registered: 2012-02-24
Posts: 2

how to stop a sprite using the forever function from repeating:

its a space invaders type game. but when you shoot the 'space invader' it just reappears, any solutions?

Offline

 

#2 2012-03-12 09:32:49

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

Re: how to stop a sprite using the forever function from repeating:

Instead of forever, use "repeat until < >".  When the statement in the < > becomes true, it will stop repeating.   smile

Offline

 

#3 2012-03-12 09:35:48

Splodgey
Scratcher
Registered: 2011-04-26
Posts: 500+

Re: how to stop a sprite using the forever function from repeating:

I'm not sure how to help because I don't know what your scripts are... Probably something like this...?

when gf clicked
forever
if <touching [Bullet thing v]?>
hide
stop script
Edit: Oh Greenatic beet me to it...

Last edited by Splodgey (2012-03-12 09:38:09)

Offline

 

#4 2012-03-12 15:35:35

turkey3
Scratcher
Registered: 2011-12-04
Posts: 500+

Re: how to stop a sprite using the forever function from repeating:

Splodgey wrote:

I'm not sure how to help because I don't know what your scripts are... Probably something like this...?

when gf clicked
forever
if <touching [Bullet thing v]?>
hide
stop script
Edit: Oh Greenatic beet me to it...

Actually, wih this script it wouldn't reappear because it stops the script, and there's no "show"

Offline

 

#5 2012-03-12 20:50:50

MaxFlyboy
Scratcher
Registered: 2011-11-07
Posts: 100+

Re: how to stop a sprite using the forever function from repeating:

when gf clicked
forever
if <touching [bullet v]>
hide
wait 5 secs
show
end
end

Last edited by MaxFlyboy (2012-03-12 20:51:15)


http://cdn.voodoofilm.org/images/upload/thumb/viral-video-2011.jpg click the picture for an AMV

Offline

 

#6 2012-03-12 21:10:52

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

Re: how to stop a sprite using the forever function from repeating:

MaxFlyboy wrote:

when gf clicked
forever
if <touching [bullet v]?>
hide
wait (5) secs
show
end
end

Scratchblocks fixed.

Offline

 

#7 2012-03-12 21:17:43

MaxFlyboy
Scratcher
Registered: 2011-11-07
Posts: 100+

Re: how to stop a sprite using the forever function from repeating:

I always have trouble with the "touching" block


http://cdn.voodoofilm.org/images/upload/thumb/viral-video-2011.jpg click the picture for an AMV

Offline

 

#8 2012-03-12 21:31:00

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

Re: how to stop a sprite using the forever function from repeating:

MaxFlyboy wrote:

I always have trouble with the "touching" block

Just remember that most booleans have a "?".  (if you're referring to the scratchblocks)

Offline

 

#9 2012-03-13 05:27:00

Splodgey
Scratcher
Registered: 2011-04-26
Posts: 500+

Re: how to stop a sprite using the forever function from repeating:

turkey3 wrote:

Splodgey wrote:

I'm not sure how to help because I don't know what your scripts are... Probably something like this...?

when gf clicked
forever
if <touching [Bullet thing v]?>
hide
stop script
Edit: Oh Greenatic beet me to it...

Actually, wih this script it wouldn't reappear because it stops the script, and there's no "show"

It's not supposed to! The problem was that it DOES reappear.

Offline

 

#10 2012-03-14 10:54:49

sidthekoala
New Scratcher
Registered: 2012-03-06
Posts: 15

Re: how to stop a sprite using the forever function from repeating:

Just use a stop script at the end

Offline

 

#11 2012-03-14 11:00:37

99fhenwood
New Scratcher
Registered: 2012-03-14
Posts: 3

Re: how to stop a sprite using the forever function from repeating:

suchak wrote:

its a space invaders type game. but when you shoot the 'space invader' it just reappears, any solutions?

Nice Question, In my opinon you need to have this block:

stop script
-Henwood  smile

Offline

 

Board footer