Esempio n. 1
0
        protected void StartMovementTween(Vector2 direction)
        {
            MovementTween.RemoveAll();

            const float duration = 0.5f;

            MovementTween.InterpolateProperty(this, nameof(Position),
                                              Position, Position + direction * 6, duration);
            MovementTween.Start();
        }
Esempio n. 2
0
        public void Push(Vector2 direction)
        {
            if (MovementTween.IsActive())
            {
                return;
            }
            if (TestMove(GlobalTransform, direction * 6))
            {
                return;
            }

            AnimationPlayer.Play("Roll");
            StartMovementTween(direction);
        }