Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Switching back to the previous background.
- jakesmithey
-
3 posts
Switching back to the previous background.
Hello,
I'm currently making a maze game for coursework and have stumbled upon a issue. (Not been using scratch for long) I have made a help background for if players get stuck, they press H and are re-directed to a help page for 10 seconds. However after them ten seconds I need it to switch back to the previous background. My game has over a dozen levels so I couldn't use switch to background _ or switch to background -1. If possible could you please tell me a way to switch to a previous background.
Thanks,
Jake
I'm currently making a maze game for coursework and have stumbled upon a issue. (Not been using scratch for long) I have made a help background for if players get stuck, they press H and are re-directed to a help page for 10 seconds. However after them ten seconds I need it to switch back to the previous background. My game has over a dozen levels so I couldn't use switch to background _ or switch to background -1. If possible could you please tell me a way to switch to a previous background.
Thanks,
Jake
- DotDash
-
1000+ posts
Switching back to the previous background.
do this:
switch backdrop to (Backdrop # - 1)
switch backdrop to (Backdrop # - 1)
Last edited by DotDash (July 24, 2013 14:53:58)
- Psiborg
-
500+ posts
Switching back to the previous background.
I think Jake needs to go back to the backdrop the user was previously on, rather than the previous one in the list. Therefore a solution would be to store the backdrop # in a variable before switching to the help backdrop and then switch the backdrop back to the number previously stored afterwards. do this:
switch backdrop to (Backdrop # - 1)
- footsocktoe
-
1000+ posts
Switching back to the previous background.
I agree. When the user presses H, then the current backdrop # is stored in a variable so it can be retrieved when H is over.
- ZeldaFett
-
1 post
Switching back to the previous background.
How would you do this? I'm trying to make a pause menu so when you press the play sprite it will go back to the Backdrop or “level” you were on before the pause. I just don't know exactly how to store the variable. Actually, I know nothing about variables. A little help?
Last edited by ZeldaFett (Sept. 2, 2013 03:08:02)
- drmcw
-
1000+ posts
Switching back to the previous background.
How would you do this? I'm trying to make a pause menu so when you press the play sprite it will go back to the Backdrop or “level” you were on before the pause. I just don't know exactly how to store the variable. Actually, I know nothing about variables. A little help?
In Data press make a variable and give the variable a name like Last Backdrop. Press ok and you should end up with some new blocks. You might want to untick the checkbox to hide the variable but there are also blocks to achieve this if you want to do that in your scripts. Then to remember the backdrop use
then when you have to return use
Last edited by drmcw (Sept. 2, 2013 06:24:12)
- turkey3
-
1000+ posts
Switching back to the previous background.
And actually, in the do this:switch backdrop to () block, there is an option called “previous backdrop” (which does your workaround). However, it is not in the switch costume to () block
switch backdrop to (Backdrop # - 1)

- curiouscrab
-
500+ posts
Switching back to the previous background.
You meanAnd actually, in the do this:switch backdrop to () block, there is an option called “previous backdrop” (which does your workaround). However, it is not in the switch costume to () block
switch backdrop to (Backdrop # - 1)
- SCRATHCREATOR950
-
12 posts
Switching back to the previous background.
Here is the answer 





its under the line where
- HyperPixel
-
46 posts
Switching back to the previous background.
In Data press make a variable and give the variable a name like
Press ok and you should end up with some new blocks.
Last edited by HyperPixel (April 9, 2014 00:30:36)
- FlashX73
-
8 posts
Switching back to the previous background.
Simply make the help option a sprite with the following:
It doesn't have to be a backdrop…unless it's something different you're talking about, please let me know…
It doesn't have to be a backdrop…unless it's something different you're talking about, please let me know…
- SolarSon
-
100+ posts
Switching back to the previous background.
Here is the answerits under the line where
Last edited by SolarSon (July 4, 2015 21:11:12)
- jshrubb
-
1 post
Switching back to the previous background.
HOW DO I HAVE SO I CAN CHANGE TO DIFFERENT BACKDROP ARFTER 10 SECONDS
- Qwertsick
-
51 posts
Switching back to the previous background.
HOW DO I…
Please don't necropost. to answer your question tho, do this:
Last edited by Qwertsick (April 27, 2018 16:44:24)
- Sunflower9567
-
4 posts
Switching back to the previous background.
Hi. I am a fairly new Scratcher, and I have a question. If I'm testing my game and I want to start the game from the beggining, it starts me from where I left off on that background.
I need help PLEASE!
Thanks,
Love,
@Sunflower9567

Thanks,
Love,
@Sunflower9567
- mlcreater
-
1000+ posts
Switching back to the previous background.
Don't necropost; check the dates first. Please create your own topic. Hi. I am a fairly new Scratcher, and I have a question. If I'm testing my game and I want to start the game from the beggining, it starts me from where I left off on that background.I need help PLEASE!
Thanks,
Love,
@Sunflower9567
- deck26
-
1000+ posts
Switching back to the previous background.
Ideally yes, create your own topic but this is a simple one. In a green flag script tell your project what the starting conditions should be. Hi. I am a fairly new Scratcher, and I have a question. If I'm testing my game and I want to start the game from the beggining, it starts me from where I left off on that background.I need help PLEASE!
Thanks,
Love,
@Sunflower9567
It's actually good practice to initialise everything before any game play.
- Discussion Forums
- » Help with Scripts
-
» Switching back to the previous background.