Beispiel #1
0
        /// <summary>
        /// this method will update the random follow position ever 400 ticks xd
        /// </summary>
        public static void UpdateFollowPos()
        {
            if (Environment.TickCount - _timeSinceLastFollowPosUpdate > 400)
            {
                _timeSinceLastFollowPosUpdate = Environment.TickCount;
                if ((_carry.IsDead || _carry.InFountain()) && _tempCarry != null)
                {
                    var point =
                        new Geometry.Circle(_tempCarry.Position.LSTo2D(), 300).ToPolygon()
                        .ToClipperPath()
                        .OrderBy(p => new Random().Next())
                        .FirstOrDefault();

                    _followPos = new Vector2(point.X, point.Y).To3D();
                }
                else
                {
                    var point =
                        new Geometry.Circle(_carry.Position.LSTo2D(), 300).ToPolygon()
                        .ToClipperPath()
                        .OrderBy(p => new Random().Next())
                        .FirstOrDefault();

                    _followPos = new Vector2(point.X, point.Y).To3D();
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// this method will update the random follow position ever 400 ticks xd
        /// </summary>
        public static void UpdateFollowPos()
        {
            if (Environment.TickCount - _timeSinceLastFollowPosUpdate > 400)
            {
                _timeSinceLastFollowPosUpdate = Environment.TickCount;
                if ((_carry.IsDead || _carry.InFountain()) && _tempCarry != null)
                {
                    var point =
                        new Geometry.Circle(_tempCarry.Position.To2D(), 300).ToPolygon()
                            .ToClipperPath()
                            .OrderBy(p => new Random().Next())
                            .FirstOrDefault();

                    _followPos = new Vector2(point.X, point.Y).To3D();
                }
                else
                {
                    var point =
                        new Geometry.Circle(_carry.Position.To2D(), 300).ToPolygon()
                            .ToClipperPath()
                            .OrderBy(p => new Random().Next())
                            .FirstOrDefault();

                    _followPos = new Vector2(point.X, point.Y).To3D();
                }
            }
        }