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.
I loved this project but I felt like watching the yellow circle bounce around objects with the same placement got boring, so I added a tiny bit of code to make the objects movable, enjoy and thanks to grandpasp!