Example #1
0
        public void MoveTo(Point to, Point turnTo)
        {
            var self = MyStrategy.ASelf;

            if (turnTo != null)
            {
                _move.Turn = Utility.EnsureInterval(MyStrategy.Self.GetAngleTo(turnTo.X, turnTo.Y), self.MaxTurnAngle);
            }

            if (to != null && !Utility.PointsEqual(self, to))
            {
                var angle = self.GetAngleTo(to);
                var d     = AWizard._getHalfEllipseDxDy(self.MaxStrafeSpeed, self.MaxForwardSpeed, self.MaxBackwardSpeed, angle);

                _move.Speed       = d.Y;
                _move.StrafeSpeed = d.X;
            }
        }