public class biocircle { double r; //Point Pos; double posX, posY; public bool isLive() {return (r > 0);} public double collision(double enemyR, double enemyPosX, double enemyPosY) { double dist = Math.Sqrt(Math.Pow(enemyPosX - posX, 2) + Math.Pow(enemyPosY - posY, 2)); if (enemyR + r < dist) return 0; double rez = (enemyR > r) ? enemyR + r - dist : dist - enemyR - r; r -= rez; return rez; } public biocircle(double Radius, double PosX, double PosY) { this.r = Radius; this.posX = PosX; this.posY = PosY; } }