Question

Im making an Android game and I'm looking for a relatively simple tutorial on ball collision detection. In particular an elastic collision between 2 balls (That is to say how balls would behave after the collision - kinda like pool balls when they collide).

Also, if anyone knows of an example/ tutorial on deceleration and acceleration I would appreciate it. I'm detecting if 2 balls are in proximity (not colliding yet) with each other. If ball 1 is within a certain radius of a static ball 2, ball 1 will start to decelerate. Once ball 1 reaches another point closer to ball 2, ball 1 will change direction and start accelerating again to its original velocity.

I can detect the first collision and decelerate ball 1, as well as switch its direction, but the acceleration I implemented is not correct.

If someone maybe knows of such an example, can you maybe point me in the right direction?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top