Discuss Scratch

KokosoviOrech
Scratcher
4 posts

Changing multiple backgrounds at X or Y position

Lets say i want to change backdrop when sprite reaches Y position 155 and then teleport my sprite down, but it changes background 3 or 4 times untill it stops and i want it to do just once. how do i do so?
deck26
Scratcher
1000+ posts

Changing multiple backgrounds at X or Y position

Best if you share the project.
LightningTPN
Scratcher
90 posts

Changing multiple backgrounds at X or Y position

you can use wait blocks. This might cause some problems if there are multiple codes running in the same script.

if <(x position) = [155]> then
do something
wait (0.5) secs
end

if <(x position) = [155]> then
do something
wait until <(x position) = [155]>
end

I will be able to tell you much better if you can share the project.
bluedragon8633
Scratcher
1000+ posts

Changing multiple backgrounds at X or Y position

If you're using a non-specific block (“next backdrop” vs. "switch backdrop to “), the sprite may trigger the ”next backdrop" multiple times before getting a chance to teleport away. You can fix this by making the code more specific, or adding a wait until <not y=155> block.
KokosoviOrech
Scratcher
4 posts

Changing multiple backgrounds at X or Y position


bluedragon8633 wrote:

If you're using a non-specific block (“next backdrop” vs. "switch backdrop to “), the sprite may trigger the ”next backdrop" multiple times before getting a chance to teleport away. You can fix this by making the code more specific, or adding a wait until <not y=155> block.



Yea thanks this helped

Powered by DjangoBB