Discuss Scratch

iidonut
Scratcher
8 posts

Moving to next backdrop using sprites

So I have this project where I want the sprites to go to a certain location on the screen, but when they go to that location they are meant to go to the next backdrop. However, the sprite doesn't go to the next backdrop and just goes back to the starting point of the backdrop it was on before. When I click on the “switch to next backdrop” block, it moves the sprite to the next backdrop but the sprite is still affected by the obstacles that are in the previous backdrop, and I can't always just click on the block to move to the next backdrop. This is my script.
when backdrop switches to [backdrop14 v]
if <y position> < <-170> then
go to x: (-207) y: (90)
forever
switch backdrop to [next backdrop v]
I don't know if this is a bug or if it's just my script.

*edit* I have tried some other way to continue to the next backdrop so I won't be needing any more help anymore. Thanks to everyone that tried to help"

Last edited by iidonut (Dec. 20, 2021 23:58:22)

lovelimpan
Scratcher
100+ posts

Moving to next backdrop using sprites

iidonut wrote:

So I have this project where I want the sprites to go to a certain location on the screen, but when they go to that location they are meant to go to the next backdrop. However, the sprite doesn't go to the next backdrop and just goes back to the starting point of the backdrop it was on before. When I click on the “switch to next backdrop” block, it moves the sprite to the next backdrop but the sprite is still affected by the obstacles that are in the previous backdrop, and I can't always just click on the block to move to the next backdrop. This is my script.
when green flag clicked
forever
if <touching [sprite2 v] ?> then
switch backdrop to [next backdrop v]
end
end

FLOPPA
I like to do suggested blocks
((color v) effect :: looks)
<hiding? :: looks>
<showing? :: looks>
<touching [Clone] ? :: control>
when stop button is clicked
I am [url=scratch.mit.edu/users/lovelimpan]here[/url]
deck26
Scratcher
1000+ posts

Moving to next backdrop using sprites

Share the project rather than a script out of context please. You don't want to switch backdrop in a forever loop with nothing stopping it happening over and over again.
Rahdzz
New to Scratch
19 posts

Moving to next backdrop using sprites

this would cause lag, I am sure of it!
iidonut
Scratcher
8 posts

Moving to next backdrop using sprites

You don't want to switch backdrop in a forever loop with nothing stopping it happening over and over again.
this would cause lag, I am sure of it!
Even with the forever loop not around it, the bug still happens. And, it really doesn't cause that much lag, but the bug glitches my game out a lot.

Powered by DjangoBB