Ejemplo n.º 1
0
        public void MoveToNextPos()
        {
            nextNode = FP.Next(nextNode, positionNodes, true);

            //set the animation
            if (nextNode.X - this.X > 0)
            {
                spritemap.FlippedX = true;
            }
            else if (nextNode.X - this.X < 0)
            {
                spritemap.FlippedX = false;
            }

            if (!isAttacking)
            {
                if (nextNode.X - this.X == 0)
                {
                    spritemap.Play("Idle");
                }
                else
                {
                    spritemap.Play("Move");
                }
            }

            var twoon = new MultiVarTween(MoveToNextPos, ONESHOT);

            twoon.Tween(this, new { X = nextNode.X, Y = nextNode.Y }, 5.0f);
            AddTween(twoon, true);
        }
Ejemplo n.º 2
0
        public void MoveToNextPos()
        {
            currentPosition = FP.Next(currentPosition, positionNodes, true);
            var twoon = new MultiVarTween(MoveToNextPos, ONESHOT);

            twoon.Tween(this, new { X = currentPosition.X, Y = currentPosition.Y }, 5.0f);
            AddTween(twoon, true);
        }