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

#1 2011-01-22 07:24:43

Hourken
New Scratcher
Registered: 2011-01-21
Posts: 6

How to switch levels?

I cant figure out how to switch levels someone pls help.

Offline

 

#2 2011-01-22 14:51:35

ian528
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: How to switch levels?

In scratch, you actully have to make a new level....

Offline

 

#3 2011-01-22 15:39:35

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: How to switch levels?

Assuming you're making a game that has the background as the level and a goal you need to get to, the scripts should look something like this:

On Character

Code:

When green flag clicked
Forever if <touching goal>
    broadcast next level
    wait until <not touching goal>
End

On Stage

Code:

When I receive next level
next background

http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#4 2011-01-22 16:19:34

Hourken
New Scratcher
Registered: 2011-01-21
Posts: 6

Re: How to switch levels?

I tried your suggestion Harakou.  The on problem though is that if you're just switching costumes you cant change scripts for the second lvl.  For example this is the script for one of my monsters.
<when green flag clicked>
<forever>
<hide>
<wait(2)secsc>
<show>
<wait(4)secsc>

I cant change the amount of secs that the monster is dissappearing to make it harder.  If you do know how to thought then pls tell me.

Offline

 

#5 2011-01-22 16:55:15

Lar-Rew
Scratcher
Registered: 2010-02-19
Posts: 100+

Re: How to switch levels?

You can use variables; you can do wait X seconds instead of wait 2 seconds.  Then, you just need to set the variable with with this block: <change{ X }by(

Offline

 

#6 2011-01-24 15:32:34

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: How to switch levels?

You can use variables to adjust that. For example, you could change your script to look like this:
[blocks]<when green flag clicked>
<forever>
<hide>
<wait(  ((  <{ level }>  <*> 2  )) )secs>
<show>
<wait( 4 )secs>
<end>[blocks]


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#7 2011-01-24 16:04:19

lilacfuzz101
Scratcher
Registered: 2010-05-22
Posts: 1000+

Re: How to switch levels?

or you can use Clutter


http://25.media.tumblr.com/tumblr_lzqaicLrY01r5wdo7o1_500.gif

Offline

 

#8 2011-01-24 16:07:07

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: How to switch levels?

lilacfuzz101 wrote:

or you can use Clutter

Personally, I think it's highly inefficient to load an entire project just for a new level.  neutral


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

Board footer