Ejemplo n.º 1
0
        public static bool AreColliding(PlayerDot playerDot, CircleArc circleArc)
        {
            double playerDotRadian      = playerDot.GetRadian();
            double circleArcBeginRadian = circleArc.GetRadianInterval().Item1;
            double circleArcEndRadian   = circleArc.GetRadianInterval().Item2;

            if (circleArcBeginRadian < circleArcEndRadian)
            {
                circleArcBeginRadian += 2 * Math.PI;
                if (playerDotRadian < circleArcEndRadian)
                {
                    playerDotRadian += 2 * Math.PI;
                }
            }

            return(circleArcBeginRadian >= playerDotRadian && circleArcEndRadian <= playerDotRadian);
        }
Ejemplo n.º 2
0
 public Circle(int radius)
 {
     this.radius = radius;
     playerDot   = new PlayerDot(radius);
     circleArc   = new CircleArc(0.5, Math.PI / 2);
 }