public void AddBalloon(Point point) { Random r = new Random(); Balloon balloon = new Balloon(point, r.Next(20, 30)); Balloons.Add(balloon); }
public bool IsTouching(Balloon ballon) { double distance = (Center.X - ballon.Center.X) * (Center.X - ballon.Center.X) + (Center.Y - ballon.Center.Y) * (Center.Y - ballon.Center.Y); return distance <= ((Radius + ballon.Radius) * (Radius + ballon.Radius)); }
public bool IsTouching(Balloon ballon) { double distance = (Center.X - ballon.Center.X) * (Center.X - ballon.Center.X) + (Center.Y - ballon.Center.Y) * (Center.Y - ballon.Center.Y); return(distance <= ((Radius + ballon.Radius) * (Radius + ballon.Radius))); }