The game is a 2D platformer.
The problem I have is when I press the B button to crouch from standing, I do not know how to implement a function where B can be pressed again to move back to the standing sprite.
the issue is if i use the code presented below it will check every frame for B == Pressed, basically appearing as if the player never crouched at all. Could somebody help please?
if (facingRightSide == true)
{
if (currPad.Buttons.B == ButtonState.Pressed)
{
m_currState = AnimState.CrouchRight;
isCrouchedRight = true;
}
}
if (isCrouchedRight == true)
{
if (currPad.Buttons.B == ButtonState.Pressed)
{
m_currState = AnimState.FacingRight;
isCrouchedRight = false;
}
}
Thank you for your time.