I am trying to implement realistic physics for my game plinko. As of now i only implemented the inversion of the velocity and the distance between both objects.
public void changedirX () { velocityx = -velocityx; } public void changedirY() { velocityy = -velocityy; } And the 'back bounce' of the ball gets implemented here:
if (Circle.isColliding(win1, kugel)){ //gewinn berechnen, Kugel entfernen } Now the ball just bounces back infinitely until it hits the bounds of the canvas. I know that i need to implement the airresistance but do not know how to start. The questions answered here on StackExchange do not have any full code unfortunately. How can i let the ball bounce realistically without just falling down vertical.