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

#1 2008-05-26 10:28:28

frake
Scratcher
Registered: 2008-05-26
Posts: 2

changing levels and backgrounds

Hi,
I'm trying to change to levels (locations) with a different background, set of sprites, blocks, etc. Untill now I can only change backgrounds and I must hide all the spritis i don't want to see.
There must be a way tochange the whole scenery or load a new stage?

Offline

 

#2 2008-05-26 10:55:40

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: changing levels and backgrounds

I usually use a variable to indicate what level it is.  When the level is changed, a broadcast can be sent to all the sprites and the background.  They then check this variable, and depending on its value, change costume, change location or show/hide.

A good example of this is the rebuild of Freestylin' Monkeys Chinye project, where I replaced his multiple brodcasts with a variable checking system.

http://scratch.mit.edu/projects/Mayhem/161719


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#3 2008-05-26 14:20:27

frake
Scratcher
Registered: 2008-05-26
Posts: 2

Re: changing levels and backgrounds

Thanks,
I'll handle it your way. Still, if all the sprites are constantly on the stage (hidden or not) you can get in pretty complicated situations,
But OK, i suspect that soon we will be able to load stages,
Frake

Offline

 

Board footer