Discuss Scratch

Murphy1214
Scratcher
4 posts

switching to a backdrop when x= a certain position as rooms

I'm making a game https://scratch.mit.edu/projects/1231238855/ and I want to have the character go to a certain x position and then it will switch the backdrop like a room can somebody help?
Catscratcher07
Scratcher
1000+ posts

switching to a backdrop when x= a certain position as rooms

In your main loop, constantly check for x being greater than a certain value (do not use equals since you cannot guarantee the player will be at an exact position), and if so, set the player's x and y to wherever you want them to start a room at and change the backdrop.
KMFpenguin
Scratcher
100+ posts

switching to a backdrop when x= a certain position as rooms

when green flag clicked
forever
if <<(x position) > [#]> and <(x position) < [#]>> then
switch backdrop to [the backdrop you want v]
end

Like Catscratcher07 said, you don't want the location to be too precise so probably give it a range like in this code. (This is basically what they said only explained in scratchblocks)

Powered by DjangoBB