Some times, as well as "if on edge, bounce" we may need to "bounce" off a different surface. If we know the angle of that object, this code calculates the required bounce angle.
Credit to @awesome-llama for the "difference between angles" code. Has a bug where sometimes (rarely) the ball blows through the line. It seems to happen when the ball is gliding almost parallel to the line. I haven't tracked it down yet but I'm working on it. For now, just restart it to get it back on track. I would be happy to hear suggestions. Two investigations into the potential problem: https://scratch.mit.edu/projects/1182820042 https://scratch.mit.edu/projects/1182845528 Update: I may have worked around the bug.