private void updateStop(float a_deltaTime)
{
if (m_speed.Y != 0)
{
m_currentState = State.Jumping;
return;
}
if (KeyboardHandler.keyClicked(GameState.getRollKey()) && m_rollActionCD <= 0)
{
m_currentState = State.Rolling;
m_rollSound.play();
return;
}
if (( KeyboardHandler.isKeyPressed(GameState.getLeftKey()) && !KeyboardHandler.isKeyPressed(GameState.getRightKey()))
|| (KeyboardHandler.isKeyPressed(GameState.getRightKey()) && !KeyboardHandler.isKeyPressed(GameState.getLeftKey())))
{
m_currentState = State.Walking;
if (KeyboardHandler.isKeyPressed(GameState.getLeftKey()))
{
m_facingRight = false;
}
else
{
m_facingRight = true;
}
}
if (KeyboardHandler.keyClicked(GameState.getJumpKey()))
{
m_speed.Y -= JUMPSTRENGTH;
m_currentState = State.Jumping;
m_jumpSound.play();
}
}