Beispiel #1
0
        public void AddBall(Point position)
        {
            SmallBall b = new SmallBall();

            b.Center = position;
            balls.Add(b);
        }
Beispiel #2
0
 public bool Touches(SmallBall ball)
 {
     return((ball.Center.X - Center.X) * (ball.Center.X - Center.X) + (ball.Center.Y - Center.Y) * (ball.Center.Y - Center.Y) <= RADIUS * RADIUS);
 }
Beispiel #3
0
        public bool isCollidingSmall(SmallBall smallBall)
        {
            double distanceSmallBall = (Center.X - smallBall.Center.X) * (Center.X - smallBall.Center.X) + (Center.Y - smallBall.Center.Y) * (Center.Y - smallBall.Center.Y);

            return(isHit && distanceSmallBall <= (radius + smallBall.radius) * (radius + smallBall.radius));
        }