Example #1
0
        protected virtual void SetAnimations()
        {
            if (isAttacking)
            {
                if (!facingRight)
                {
                    _animationManager.Play(_animations["enemyattackR"]);
                }
                else
                {
                    _animationManager.Play(_animations["enemyattackL"]);
                }
            }

            else if (Velocity.X > 0 && !isAttacking)
            {
                _animationManager.Play(_animations["enemywalkR"]);
            }
            else if (Velocity.X < 0 && !isAttacking)

            {
                _animationManager.Play(_animations["enemywalkL"]);
            }
            else
            {
                _animationManager.Stop();
            }
        }
Example #2
0
        protected virtual void SetAnimations()
        {
            if (Velocity.X > 0)
                _animationManager.Play(_animations["WalkRight"]);
            /* else if (Velocity.X < 0)
               _animationManager.Play(_animations["WalkLeft"]);
             else if (Velocity.Y > 0)
               _animationManager.Play(_animations["WalkDown"]);
             else if (Velocity.Y < 0)
               _animationManager.Play(_animations["WalkUp"]);*/


            else if (Velocity.X < 0)

            {
                _animationManager.Play(_animations["WalkLeft"]);
            }

            else if (IsAttacking)
            {
                _animationManager.Play(_animations["attack"]);

            }
            else _animationManager.Stop();
        }
Example #3
0
        protected virtual void SetAnimations()
        {
            if (IsAttacking)
            {
                _animationManager.Play(_animations["attack"]);
                IsAttacking = false;
            }
            else if (Velocity.X > 0)
            {
                _animationManager.Play(_animations["WalkRight"]);
            }

            else if (Velocity.X < 0)

            {
                _animationManager.Play(_animations["WalkLeft"]);
            }
            else
            {
                _animationManager.Stop();
            }
        }