I am creating a game that has the character traveling through different scenes. How do I make the background change when the character gets to the edge of his current background? I'm thinking something like "If sprite 1 is touching edge, change background". I can not seem to find a way to do that.
Offline
This has nothing to do with advanced topics.
Offline
It should go in All About Scratch. I'll move it there for you.
To do what you want, you might want to use Broadcast Messages. Have the sprite check to see when it is touching an edge or has an X position greater than a given value, and then have it send a message. The stage can be set up to receive the message and do the background change.
Offline
Hey, I have an idea! How about making a variable. That way, you could do this:
When Flag Pressed,
{forever
set 'variable' to 0
if touching edge,
change variable by 1
{if variable = 1
next background}
forever}
I haven't tested it yet, but I think it'll work. Because there's a forever, the variable will always be 0 unless you touch the edge!
Offline