Beispiel #1
0
        public override void Run()
        {
            //throw new NotImplementedException();
            if (Count % 100 < 70)
            {
                Vector2 preVector = new Vector2(Vector.X, Vector.Y);
                preVector = Vector2.Normalize(preVector);

                Vector = target.Point - this.Point;
                Vector = Vector2.Normalize(Vector);

                if (preVector.X * Vector.X + preVector.Y * Vector.Y > Math.Cos(MaxDegree))
                {
                    Vector = new Vector2((float)((Math.Cos(MaxDegree) - Math.Sin(MaxDegree)) * preVector.X),
                                         (float)((Math.Sin(MaxDegree) + Math.Cos(MaxDegree)) * preVector.Y));
                }

                Vector = Vector * 3;
            }

            Point = Point + Vector;

            Count += (int)Vector.Length();

            if (Count > LimitCount)
            {
                Remove();
                DrawTool.RemoveLabel(Name);
            }
        }
Beispiel #2
0
        public override void Run()
        {
            //throw new NotImplementedException();
            Point = Point + Vector;

            Count += (int)Vector.Length();

            if (Count > LimitCount)
            {
                Remove();
                DrawTool.RemoveLabel(Name);
            }
        }