private bool checkNewCircleCollision(int x, int y, Circle circle, ref bool valid) { var d = PixelUtilities.CalculateDistanceBetweenPixels(x, y, circle.X, circle.Y); if (d < circle.Radius + this.currentNewCircleRadius + 2) { valid = false; return(true); } return(false); }
private static bool checkCircleGrowthCollision(Circle circle, Circle other) { var d = PixelUtilities.CalculateDistanceBetweenPixels(circle.X, circle.Y, other.X, other.Y); var distance = circle.Radius + other.Radius; if (d - 2 < distance) { circle.Growing = false; return(true); } return(false); }