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

#1 2009-01-19 18:28:34

i_caught_fire_2
Scratcher
Registered: 2008-12-23
Posts: 20

Need help with levels.

I did make a Level Variable but It didnt seem to help at all. How do I make it so when one health runs out, it switches to the next level and changes characters.


http://scratch.mit.edu/projects/i_caught_fire_2/385230

Offline

 

#2 2009-01-19 19:14:55

i_caught_fire_2
Scratcher
Registered: 2008-12-23
Posts: 20

Re: Need help with levels.

bump

Offline

 

#3 2009-01-19 19:21:36

i_caught_fire_2
Scratcher
Registered: 2008-12-23
Posts: 20

Re: Need help with levels.

none?

Offline

 

#4 2009-01-20 05:17:44

pokemon_master12
Scratcher
Registered: 2008-09-26
Posts: 100+

Re: Need help with levels.

If you mean that when the SPRITES' health has run out, what you need to do is this:
Make a health variable for each sprite, including the one you are playing as, and a level variable. At the beginning of the game, set the level variable to 1 and the health variable to however much health you want you and the enemies to have. Say the sprite you are playing as is called Sprite1, and the enemies are called Enemy1, Enemy2 etc. You need to make a script like this for all the enemy sprites and the sprite you are playing as:

[blocks]<when green flag clicked>[/blocks]
[blocks]<forever if>[/blocks][blocks]<( [blocks]<{ health }>[/blocks] <=> 0 )>[/blocks]
[blocks]<set{ level }to( 2[/blocks]
[blocks]<broadcast[ next level ]and wait c>[/blocks]
[blocks]<end>[/blocks]

Then what will happen is that when the enemy's health or your health has run out, the level will change. If you want ALL the enemies' health to run out before the level changes though, you'll need to include an
[blocks]<<  <and>  >>[/blocks]

to your script.
Hope this helps! If it doesn't, just let me know!

Happy Scratch-ing!  smile


My Dragon Egg! http://dragcave.net/image/5YUA.gif
Visit my blog: http://freyasworld.wordpress.com/

Offline

 

#5 2009-01-20 10:02:44

i_caught_fire_2
Scratcher
Registered: 2008-12-23
Posts: 20

Re: Need help with levels.

Thanks. I acualy finished it last night... at 1 am.............................................................................................................................

Offline

 

Board footer