Is the pythagorean theorem not working for calculating distance, is the collision logic is flawed, or is the problem somewhere else in the code?
The program uses the pythagorean theorem to calculate the distance between a bullet and a ball. I’m using the radius to see if they are colliding. The problem is that the hp of the balls is being decreased or being deleted without the bullet colliding with the ball. Sometimes this happens when the ball is very far away from the bullet(on the other side of the screen).