Ball doesn't bounce off edge - need help!

Hi there,
I started programming a billard app. The white ball hits the yellow ball (at rest) and both move correctly afterwards.
But, when the white ball hits the edge, it doesn't bounce off allthough I use the "when any Ball.RandErreicht" eventhandler. Instead the white ball sticks to the dege and moves on along the edge??

When I change the initial direction of the white ball, it bounces off edges correctly in many cases.
I have no clue, what I did wrong!?


Billard.aia (4.5 KB)

Have you tried using the edge block for the white ball, instead of the any component block? It could be that the any component system considers that the white ball has "already been handled" ?

Yes, I did, but there ist no difference.
And bouncing also works fine with the any component block when I change the initial angle of the white ball. The white ball then bounces off edges many times, until it hits the yellow ball. After that it sticks to the next edge :thinking:

You may find this useful:

What you are doing seems similar to this

https://sites.google.com/view/yestermorrow-wikispaces/maths/pythagorean-theorem/programming-workshop and may have some useful information that may help you solve your issue.

1 Like