public void windowAction()
{
if (m_windowActionCD <= 0)
{
setSprite("hero_window_heave");
m_windowActionCD = 0.6f;
m_collisionShape = null;
m_img.setLooping(false);
m_stunned = true;
m_stunnedTimer = 0.4f;
m_stunnedDeacceleration = false;
m_stunnedGravity = false;
m_stunnedState = State.Hanging;
m_stunnedFlipSprite = true;
m_speed.X = 0;
m_speed.Y = 0;
m_windowActionSound.play();
if (m_currentState == State.Hanging)
{
m_imgOffsetY -= m_standHitBox.m_height / 1.8f;
}
else
{
m_imgOffsetY -= m_rollHitBox.m_height / 4f;
}
setNextPositionY(m_position.getGlobalY());
if (m_facingRight)
{
m_imgOffsetX = -4;
m_imgOffsetX -= m_standHitBox.m_width * 1.9f;
m_position.plusXWith(m_standHitBox.m_width * 1.9f);
Game.getInstance().m_camera.getPosition().plusXWith(-m_standHitBox.m_width * 1.9f);
}
else
{
m_imgOffsetX = 4;
m_position.plusXWith(-m_standHitBox.m_width * 1.9f);
Game.getInstance().m_camera.getPosition().plusXWith(m_standHitBox.m_width * 1.9f);
}
setNextPositionX(m_position.getGlobalX());
m_img.setAnimationSpeed(10);
if (m_chase)
{
deactivateChaseMode();
}
if (m_runMode)
{
activateNormalMode();
}
}
}