Discuss Scratch

theotheelectroflute
Scratcher
42 posts

How does the "next backdrop" block work?

So, I'm trying to make a platformer. Some of my script for the avatar is:

iftouchingcolor?thengotox:-200y:-20setnext leveltotruenextbackdrop

The script for the backdrop is:

whenclickedswitchcostumetolev.1foreverifnext level=truethennextbackdrop


It works, but why do I need two next backdrop blocks (the one for the avatar and the one for the backdrop)?
And if I take away one of the next backdrop blocks it goes from the first backdrop to the third backdrop to the second backdrop.

Please help,
theotheelectroflute

Last edited by theotheelectroflute (Jan. 21, 2021 20:59:57)

deck26
Scratcher
1000+ posts

How does the "next backdrop" block work?

theotheelectroflute wrote:

So, I'm trying to make a playformer. Some of my script for the avatar is:

iftouchingcolor?thengotox:-200y:-20setnext leveltotruenextbackdrop

The script for the backdrop is:

whenclickedswitchcostumetolev.1foreverifnext level=truethennextbackdrop


It works, but why do I need two next backdrop blocks (the one for the avatar and the one for the backdrop)?
And if I take away one of the next backdrop blocks it goes from the first backdrop to the third backdrop to the second backdrop.

Please help,
theotheelectroflute
You shouldn't need both and if the variable is true your forever loop is going to switch backdrops very quickly, non-stop. Best if you share the project so we can see what you're doing.
Dezach
Scratcher
100+ posts

How does the "next backdrop" block work?

Have you tried:

whenclickedswitchbackdroptolev.1foreverifnextlevel=truethennextbackdropsetnext leveltofalse
theotheelectroflute
Scratcher
42 posts

How does the "next backdrop" block work?

deck26 wrote:

theotheelectroflute wrote:

So, I'm trying to make a playformer. Some of my script for the avatar is:

iftouchingcolor?thengotox:-200y:-20setnext leveltotruenextbackdrop

The script for the backdrop is:

whenclickedswitchcostumetolev.1foreverifnext level=truethennextbackdrop


It works, but why do I need two next backdrop blocks (the one for the avatar and the one for the backdrop)?
And if I take away one of the next backdrop blocks it goes from the first backdrop to the third backdrop to the second backdrop.

Please help,
theotheelectroflute
You shouldn't need both and if the variable is true your forever loop is going to switch backdrops very quickly, non-stop. Best if you share the project so we can see what you're doing.


https://scratch.mit.edu/projects/475329304/
theotheelectroflute
Scratcher
42 posts

How does the "next backdrop" block work?

Dezach wrote:

Have you tried:

whenclickedswitchbackdroptolev.1foreverifnextlevel=truethennextbackdropsetnext leveltofalse

Thank you! It works!
lordibel
Scratcher
1000+ posts

How does the "next backdrop" block work?

The next backdrop block just switches to the next backdrop; just like how the next costume block switches to the next costume :)
FerrariBeatles127
Scratcher
1 post

How does the "next backdrop" block work?

whenclickednextbackdrop


This changes the backdrop to the next backdrop in the backdrop tab once.

Powered by DjangoBB