We want to now make the dwarf stand up by running the animation backwards, but we can't use the AnimationEnded event because that only fires when we reach the end of animation and not when we reach the beginning.

    // Add this to the if (state == "stayCrouched") block in the UpdateState method
    if (keyState.IsKeyDown(Keys.Space))
    {
        crouch.ElapsedTime = crouch.AnimationSource.Duration;
        crouch.SpeedFactor = 0;
        state = "standUp";
    }
    // Add this to the UpdateState method
    else if (state == "standUp")
    {
        if (crouch.ElapsedTime - gameTime.ElapsedGameTime.Ticks <= 0)
        {
            crouch.SpeedFactor = 1;
            crouch.ElapsedTime = 0;
            idle.ElapsedTime = 0;
            state = "idle";
        }
        else
            crouch.ElapsedTime -= gameTime.ElapsedGameTime.Ticks;
        RunController(dwarfAnimator, crouch);
    }