private void updateHiding(float a_deltaTime)
{
if (KeyboardHandler.keyClicked(GameState.getUpKey())
|| KeyboardHandler.keyClicked(GameState.getDownKey())
|| KeyboardHandler.keyClicked(GameState.getJumpKey())
|| KeyboardHandler.keyClicked(GameState.getActionKey()))
{
m_currentState = State.Stop;
if(m_img.getImagePath().StartsWith("Images//Sprite//Hero//hero_wallhide"))
{
if (m_facingRight)
{
m_position.plusXWith(40);
Game.getInstance().m_camera.getPosition().plusXWith(-40);
}
else
{
m_position.plusXWith(-40);
Game.getInstance().m_camera.getPosition().plusXWith(40);
}
}
else
{
m_collisionShape = m_standHitBox;
m_position.plusYWith(-56f);
m_layer = 0.300f;
Game.getInstance().m_camera.getPosition().plusYWith(56f);
}
m_img.setSprite("Images//Sprite//Hero//hero_stand");
m_layer = 0.300f;
}
else if (KeyboardHandler.isKeyPressed(GameState.getLeftKey()) || KeyboardHandler.isKeyPressed(GameState.getRightKey()))
{
float t_cameraXPos = 0;
if (KeyboardHandler.isKeyPressed(GameState.getRightKey()))
{
t_cameraXPos = 500;
}
else
{
t_cameraXPos = -500;
}
m_cameraPoint.X = Math.Max(Math.Min(m_cameraPoint.X + (t_cameraXPos * 1.5f * a_deltaTime), CAMERAMAXDISTANCE * 6 + m_standHitBox.m_width), -CAMERAMAXDISTANCE * 6 + m_standHitBox.m_width / 2);
}
else
{
m_cameraPoint.X = 0;
}
}