none
I woud like to make the player duck down RRS feed

  • Question

  • Hello everyone!

    I began a game 2d XNA and I woud like to make the player duck down. I have already the animation but I need to make him get down. The animation's code are bellow... Thank you for your attention!
    protected override void UpdateAnimations()
            {
                if (currentAnimation == null)
                    return;
    
                base.UpdateAnimations();
    
                if (velocidade != Vector2.Zero || jumping == true)
            
                {
                    if (direcao.X < 0 && AnimationIsNot(Animations.RunRight))
                        ChangeAnimation(Animations.RunRight);
    
                    else if (direcao.X > 0 && AnimationIsNot(Animations.RunLeft))
                        ChangeAnimation(Animations.RunLeft);
                }
                else if (velocidade == Vector2.Zero || jumping == false)
                {
                    if (direcao.X < 0 && AnimationIsNot(Animations.IdleRight))
                        ChangeAnimation(Animations.IdleRight);
    
                    else if (direcao.X > 0 && AnimationIsNot(Animations.IdleLeft))
                        ChangeAnimation(Animations.IdleLeft);
                } 

    Tuesday, February 5, 2019 12:45 PM

All replies