Sprite Lab -- If & is touching edges

Hello, experts. Thank you very much in advance.

#1 Would you please tell me how to use “is touching edges?”

#2 I thought that I could change the background color and variable value when a sprite touches the edges of that 400x400 area. Would it be possible? Then how?

Hi Mika,
I think I can help here. The tricky thing here is the way the if block is used. Because it’s connected under when run it will only check for edges exactly once when the program starts. These blocks should be moved to somewhere where they can be checked repeatedly, such as under an event or inside a behavior. Because your A sprite is “wandering”, you could add the code to check for edges inside the definition for wandering. This way it will repeatedly check for edges (and respond appropriately) as it wanders.
I hope this helps!
Mike, Curriculum Development Manager

1 Like

I made it! Thank you very much!
You get a Thank You message or Crabby Roks message at the end.

Thank You!