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

#1 2010-04-05 14:02:46

Aloys1320
Scratcher
Registered: 2010-03-12
Posts: 23

Ending a forever block

Im trying to make a game with multiple levels however my enemies are on a forever block and no matter howmany brodcasts i put i cant make it so they hide. Any ideas?

Offline

 

#2 2010-04-05 14:36:21

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Ending a forever block

You could use a variable to decide wether or not to show them... Or use the stop script block.


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#3 2010-04-05 15:17:39

climber59
Scratcher
Registered: 2009-12-15
Posts: 100+

Re: Ending a forever block

Or you could use a repeat block.

Last edited by climber59 (2010-04-05 15:18:02)


Check out my projects if you have a chance.

Offline

 

#4 2010-04-05 17:42:14

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

Re: Ending a forever block

Use the "stop script" block.

Offline

 

#5 2010-04-06 14:08:37

Stickman704
Scratcher
Registered: 2009-01-31
Posts: 1000+

Re: Ending a forever block

coolstuff wrote:

Use the "stop script" block.

For me that never works  hmm

Use a varible. enemyDefeated?

True or false. Then presumably, you would use a "if touching enemy", "set enemyDefeated" to "true". (DO NOT use an "if, else" block)

Then for the enemy put an "repeat until" "enemyDefeated? is "True" instead of a "forever"

"hope that helps"


Dun dun dun dun dun dun.... dun dun dun dun dun dun...  tongue

Offline

 

#6 2010-04-06 17:44:36

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Ending a forever block

You can place other instructions in another script...  hmm


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#7 2010-04-06 17:56:12

Aloys1320
Scratcher
Registered: 2010-03-12
Posts: 23

Re: Ending a forever block

See, I'm trying to make a level based game, with the least amount of sprites as possible. Im trying to make it so that a certain type of enemy will only show on a certain level. Thanks for the help though but my people are already on repeats and it isn't working any other ideas?

Offline

 

#8 2010-04-06 21:03:55

laser100
Scratcher
Registered: 2009-12-04
Posts: 100+

Re: Ending a forever block

Try this: http://scratch.mit.edu/projects/laser_100_test/971931
If it doesn't meet exactly your needs, I'll try to make what kind of effect you want.

Last edited by laser100 (2010-04-06 21:04:06)

Offline

 

#9 2010-04-08 02:18:34

HelenWonky
Scratcher
Registered: 2009-12-16
Posts: 100+

Re: Ending a forever block

<when I receive[ show enemy
<repeat until><( <{ hide enemy }> <=> yes )>
Do whatever enemy-stuff you do
<end>
<hide>

Hope this helps!   smile


Like The Big Bang Theory?  Like to play Secret Agent Laser Obstacle Chess?
http://www.johnoriordan.ie/wp-content/uploads/2009/04/hypnotoad.gif All glory to the Hypno-Toad.

Offline

 

Board footer