Bounce off edge?

I have a student who is beginning to design her game. She wants the “player” sprite to bounce off the edge of the background. We know how to make a sprite bounce off another sprite but can we code a bounce off the edge of the screen\background. She worked around it by coding conditions for the x and y locations and changing the velocity depending on its location but we’re still wondering about coding a bounce off the edge of the background. Here is what she has so far:

Thanks in advance.

@GordonBrune,

Have them look at the documentation for the createEdgeSprites block.

https://studio.code.org/docs/gamelab/createEdgeSprites/

I think this is what they are after.

Mike

Thanks so much. I will show her.