private void updateClimbing()
{
m_gravity = 0;
if (KeyboardHandler.isKeyPressed(GameState.getUpKey()))
{
m_speed.Y = -CLIMBINGSPEED;
}
else if (KeyboardHandler.isKeyPressed(GameState.getDownKey()))
{
m_speed.Y = CLIMBINGSPEED;
}
else
{
m_speed.Y = 0;
}
if (KeyboardHandler.keyClicked(GameState.getJumpKey()))
{
if (!KeyboardHandler.isKeyPressed(GameState.getDownKey()))
{
m_jumpSound.play();
m_speed.Y = -(JUMPSTRENGTH - 70);
if (m_facingRight)
{
m_facingRight = false;
m_speed.X -= PLAYERSPEEDCHASEMODE * 1.5f;
}
else
{
m_facingRight = true;
m_speed.X += PLAYERSPEEDCHASEMODE * 1.5f;
}
}
else
{
m_speed.Y = 0;
if (m_facingRight)
{
m_position.plusXWith(-1);
}
else
{
m_position.plusXWith(1);
}
}
m_currentState = State.Jumping;
}
if (m_ladderDirection == Direction.None)
{
if (m_speed.Y <= 0 && m_currentState == State.Climbing)
{
m_speed.Y = 0;
}
else
{
m_currentState = State.Jumping;
m_nextPosition.Y = m_position.getGlobalY() + 1;
}
}
}