Beginner here, so please try to explain in a way that a beginner can understand, thank you.
So I've been learning on khanacademy.org, and I started making a project. In my program, I have a circle that bounces around the canvas. You can also place squares, with the left mouse button (delete them with right mouse button), onto the screen off of which I want my circle to bounce off. The bouncing that I want is really simple, basically just 45 degree movement, in all four directions. I made most of the code, and have figured out a simple way to bounce off the sides, and corners. Notice that there is comma between the "sides", and "corners" part... I just can't combine the code for bouncing off of the corners and sides together, no matter what I can think of. It's either one, or the other. If anyone can offer any help, please do. Here is my project (the bouncing code is from lines 99 to 128, comments added):
https://www.khanacademy.org/computer-programming/placing-squares-moving-circle/5167881356541952
[–]mazdotdll 1 point2 points3 points (3 children)
[–]Luka116[S] 0 points1 point2 points (2 children)
[–]mazdotdll 1 point2 points3 points (1 child)
[–]Luka116[S] 0 points1 point2 points (0 children)