예제 #1
0
        public override void Update()
        {
            IAnimation2D currentAnimation2D = GetCurrentAnimation();

            if (currentAnimation2D != null)
            {
                if (currentAnimation2D.State == AnimationState.Wait)
                {
                    currentAnimation2D.Sprite = this;
                }

                if (currentAnimation2D.State != AnimationState.End)
                {
                    currentAnimation2D.Run();
                }
                if (currentAnimation2D.State == AnimationState.End)
                {
                    if (currentAnimation2D is AnimationTo)
                    {
                        AnimationTo animationTo = (currentAnimation2D as AnimationTo);
                        DrawedPoints.Add(animationTo.ToPosition);
                    }
                    Animations.Dequeue();
                    //isd = true;
                }
            }
        }
예제 #2
0
        public override void Draw()
        {
            DrawRunedLines();

            IAnimation2D currentAnimation2D = GetCurrentAnimation();

            if (currentAnimation2D is AnimationTo)
            {
                AnimationTo animationTo = (currentAnimation2D as AnimationTo);
                Vector2     fromVector  = DrawedPoints[DrawedPoints.Count - 1];
                Graphics.DrawLine(fromVector, this.Positon, Pen.Size, Pen.Color);

                /* if (isd)
                 * {
                 *   isd = false;
                 *   Console.WriteLine(string.Format("{0}->{1}", fromVector, this.Positon));
                 * }*/
            }
            DrawTexture(); //base.Draw();
            //Graphics.DrawLine(new Vector2(-100, 100), new Vector2(100, -100), 10, Color.Red);
        }
예제 #3
0
        public void Backward(float distance)
        {
            AnimationTo animationTo = new AnimationTo(this.MoveSpeed, distance, true);

            Animations.Enqueue(animationTo);
        }
예제 #4
0
        public void Forward(float distance)
        {
            AnimationTo animationTo = new AnimationTo(this.MoveSpeed, distance, false);

            Animations.Enqueue(animationTo);
        }