Discuss Scratch

RJess14
Scratcher
1 post

Changing Backgrounds and Levels

I'm trying to figure out how to change the background for different levels in a simple game. I want for the background to change when my sprite touches a certain color. Can anybody help me out?!?
mwiedmann
Scratcher
100+ posts

Changing Backgrounds and Levels

Under the “Looks” group there is the “switch backdrop to ___ ” block.

On the Stage, there is also the “next backdrop” block that can be used to cycle through the backdrops.

So you should be able to do something like:

If touching color _ then
swtich backdrop
wait 1

You may want the “wait” or some other delay so the backdrops doesn't keep switching.
turkey3
Scratcher
1000+ posts

Changing Backgrounds and Levels

^^that or this:

when flag clicked
forever
wait until <touching color _?>
next backdrop
wait until <not <touching color _?>>
MasterCard786
Scratcher
100+ posts

Changing Backgrounds and Levels

whenclickedforeveriftouchingcolor?thenswitchcostumetoswitchbackdroptogotox:y:
Something like this is good for levels of a maze or something like that!
UniMog
Scratcher
58 posts

Changing Backgrounds and Levels

Hi RJess14

Is this the sort of thing you're looking for ?
http://scratch.mit.edu/projects/18309622
saebin
New Scratcher
1 post

Changing Backgrounds and Levels

I don't have touching color
taza156
New Scratcher
1 post

Changing Backgrounds and Levels

non of this worked help plase i want to get a L6 in it
deanowalk08
New Scratcher
1 post

Changing Backgrounds and Levels

thanks!
mcc_d_96
New Scratcher
1 post

Changing Backgrounds and Levels

hello there
bookreaderno1
Scratcher
1 post

Changing Backgrounds and Levels

your tricks dont work with me!
Birdlegs
Scratcher
1000+ posts

Changing Backgrounds and Levels

The best thing to do is to make a variable for levels. This way, you have lots of control over each level. An item that only appears in one level could show if your level variable is equal to a certain level and hide if it's anything else.
Airbender101
New Scratcher
2 posts

Changing Backgrounds and Levels

when a script is over, how do you change that background to another? trying to make a background for another background. Somebody please help.
Airbender101
New Scratcher
2 posts

Changing Backgrounds and Levels

deer33816
Scratcher
3 posts

Changing Backgrounds and Levels

Well, you could try using the broadcast buttons, like you put the broadcast on a sprite, and then say that the message is called: message1. So you drag a brown broadcast block onto the background script, and you'll have something that sounds like this: When I receive message1. Then you drag a purple “change background” block, and put it under the message1. Now it'll sound like this: When I receive message1, change the background to _____.
ianengel123
New Scratcher
1 post

Changing Backgrounds and Levels

how do you change levels twice
-Scratcher-
Scratcher
100+ posts

Changing Backgrounds and Levels

JoeyTheChicken wrote:

The best thing to do is to make a variable for levels. This way, you have lots of control over each level. An item that only appears in one level could show if your level variable is equal to a certain level and hide if it's anything else.
Agree! The easiest way is to use a variable for the levels.
For the stage:
foreverswitchbackdroptoLevel
Additionally, I'm always broadcasting a message when a new Level starts, for each object for example:
whenIreceiveNextLvlifLevel=1thenshowrepeatuntilnotLevel=1DowhatyouwanttodoforLevel1ifLevel=3thenshowrepeatuntilnotLevel=3DowhatyouwanttodoforLevel3ifLevel=10thenshowrepeatuntilnotLevel=10DowhatyouwanttodoforLevel10...andsoon...hide
So, now you can control everything with one sprite, which is your player.
whenIreceiveGameStartgotostart positionshowrepeatuntilLevel=0movehowyouwantiftouchingcolor?thenchangeLevelby1broadcastNexLvlgotostart positionif touching good coloriftouchingcolor?thensetLevelto0go back to main menuif touching bad colorI usually use Level=0 for the main menu, so repeat until the game endshide

Last edited by -Scratcher- (May 29, 2015 11:02:24)

rara23
Scratcher
4 posts

Changing Backgrounds and Levels

you can do this script
whenclicked
foreveriftouchingwhatever sprite you want?thenwait0.4secsswitchbackdropto next backdropvgotox:y:0

Last edited by rara23 (July 4, 2015 23:02:30)

imalijah
Scratcher
10 posts

Changing Backgrounds and Levels

How do i make a sprite appear, on a certain level
hair444y
Scratcher
46 posts

Changing Backgrounds and Levels

imalijah wrote:

How do i make a sprite appear, on a certain level
whenclickedhidewaituntillevel=2showrepeatuntilnotlevel=2makeitdoyouwantto
jt83065
Scratcher
19 posts

Changing Backgrounds and Levels

saebin wrote:

I don't have touching color
YER YOU do you just cant find it because your a new sratcher you will lern how to one day find the block it is in the sensing or the blue hot bar

Powered by DjangoBB