Discuss Scratch

bennnyp85
New Scratcher
9 posts

Changing backgrounds

Hi there
I need to change backgrounds in my script.
The first will have a set of instructions
The next is where the fun begins
I'm able to change it from the instructions to the main one once the green flag is clicked but . . . .
My question is how do I change it back to the first background with the instructions after I click the stop button
Thanks
Ben
drmcw
Scratcher
1000+ posts

Changing backgrounds

whenthisspriteclickedswitchbackdroptoinstructions

I think what you mean is how to switch to the instructions when the game is started, so after being stopped? In which case
whenclickedswitchbackdroptoinstructions

Last edited by drmcw (April 18, 2014 11:18:10)

bennnyp85
New Scratcher
9 posts

Changing backgrounds

Heres the sript
http://scratch.mit.edu/projects/20921802/#player
How once the stop button has been click do i make it go back to the first white background?
Sorry I didnt explain to well the first time
Thanks
drmcw
Scratcher
1000+ posts

Changing backgrounds

Once the stop button has been pressed then no scripts should be running so you can't do something after the stop button has been pressed. What you would do is to have an end game event and switch the background on that.
Having said that there is a way of running a script after a stop button and that is to use the
when timer>1
block but this will only work as long as you keep resetting the timer during the game or at least just before the end in which case you may as well use an end game event.
ccree12
Scratcher
3 posts

Changing backgrounds

drmcw wrote:

whenthisspriteclickedswitchbackdroptoinstructions

I think what you mean is how to switch to the instructions when the game is started, so after being stopped? In which case
whenclickedswitchbackdroptoinstructions
I did that. I did not work
polar0909
Scratcher
28 posts

Changing backgrounds

Is what you mean when the stop button is clicked or when the game ends?
There is only a way for the second one.
deck26
Scratcher
1000+ posts

Changing backgrounds

polar0909 wrote:

Is what you mean when the stop button is clicked or when the game ends?
There is only a way for the second one.
This thread gives a method for the first one - http://scratch.mit.edu/discuss/topic/74676/
evetheawesome
New Scratcher
1 post

Changing backgrounds

i can't do
insturctions :T
PalakDwivedy
Scratcher
6 posts

Changing backgrounds

try this
whenclickedswitchbackdroptobackdrop1setvariable timerto.1foreversetvariable timertotimer+.1)



whentimer>variabletimerswitchbackdroptobaseball

Last edited by PalakDwivedy (May 15, 2020 09:30:50)

1234490873
Scratcher
55 posts

Changing backgrounds

Are you looking for a background changing example?
I'm sure you would adore this!
This is a mobile-friendly platformer game of 20 challenging levels!
I'll also adapt your suggestion if you think there is something I could improve.
Ghost Cat Platformer
1234490873
Scratcher
55 posts

Changing backgrounds

Are you looking for a background changing example?
I'm sure you would adore this!
This is a mobile-friendly platformer game of 20 challenging levels!
I'll also adapt your suggestion if you think there is something I could improve.
Ghost Cat Platformer
PalakDwivedy
Scratcher
6 posts

Changing backgrounds

hope this works!

Last edited by PalakDwivedy (May 15, 2020 09:33:40)

deck26
Scratcher
1000+ posts

Changing backgrounds

Why the necroposting? This topic is from 2014. Create a new topic if you have a question.

Powered by DjangoBB