public override void update(GameTime a_gameTime)
{
m_interactionArrow.update(a_gameTime);
m_lastPosition = m_position.getGlobalCartesian();
float t_deltaTime = ((float)a_gameTime.ElapsedGameTime.Milliseconds) / 1000f;
m_invulnerableTimer = Math.Max(m_invulnerableTimer - t_deltaTime, 0);
if (!m_stunned)
{
changeAnimation();
}
if (m_deactivateChase)
{
activateNormalMode();
m_deactivateChase = false;
}
updateState();
m_lastState = m_currentState;
if (m_currentState != State.Hanging)
{
m_gravity = 1600f;
}
updateCD(t_deltaTime);
if (!m_stunned)
{
if (!m_chase && !KeyboardHandler.isKeyPressed(GameState.getSprintKey()) && m_runMode)
{
toggleRunMode();
}
switch (m_currentState)
{
case State.Stop:
{
updateStop(t_deltaTime);
break;
}
case State.Walking:
{
updateWalking(t_deltaTime);
break;
}
case State.Jumping:
{
updateJumping(t_deltaTime);
break;
}
case State.Slide:
{
updateSliding(a_gameTime);
break;
}
case State.Climbing:
{
updateClimbing();
break;
}
case State.Rolling:
{
updateRolling(t_deltaTime);
break;
}
case State.Hanging:
{
updateHanging();
break;
}
case State.Hiding:
{
updateHiding(t_deltaTime);
break;
}
case State.Ventilation:
{
updateVentilation(t_deltaTime);
break;
}
case State.Swinging:
{
updateSwinging(t_deltaTime);
break;
}
}
}
else
{
updateStunned(t_deltaTime);
}
updateFlip();
base.update(a_gameTime);
if ((Game.getInstance().m_camera.getPosition().getLocalCartesian() - m_cameraPoint).Length() > 3)
{
Game.getInstance().m_camera.getPosition().smoothStep(m_cameraPoint, CAMERASPEED);
}
}