Exemple #1
0
        public TurtleMoveBack(ZLogoActionBase turtleAction, float distance)
            : base(turtleAction)
        {
            //_startTurleInfo = turtleAction.GetEndTurleInfo().Clone();
            var     angle      = _startTurleInfo.Angle + 180;
            var     speed      = _startTurleInfo.MoveSpeed;
            Vector2 ToPosition = Vector2Util.GetPointByPolar(_startTurleInfo.X, _startTurleInfo.Y, distance, angle);

            //_endTurleInfo = _startTurleInfo.Clone();
            _endTurleInfo.X = ToPosition.X;
            _endTurleInfo.Y = ToPosition.Y;

            speedX = (float)(speed * MathUtil.Cos(angle));
            speedY = (float)(speed * MathUtil.Sin(angle));
        }