Skip to content

Commit

Permalink
gg
Browse files Browse the repository at this point in the history
  • Loading branch information
MatusGuy committed Aug 14, 2024
1 parent f508da0 commit 15f4294
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/badguy/zeekling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,33 +227,38 @@ Zeekling::active_update(float dt_sec) {
break;

case DIVING:
{
if (m_timer.check())
{
recover();
break;
}
else
{
const float dist = m_target_y - m_start_position.y;
const double progress = CubicEaseIn(static_cast<double>(1.f - m_timer.get_progress()));
const float value = m_target_y - (static_cast<float>(progress) * dist);
const Vector pos(get_pos().x, value);
set_pos(pos);
}

const float dist = m_target_y - m_start_position.y;
const double progress = CubicEaseIn(static_cast<double>(1.f - m_timer.get_progress()));
const float value = m_target_y - (static_cast<float>(progress) * dist);
const Vector pos(get_pos().x, value);
set_pos(pos);

break;
}

case RECOVERING:
{
if (m_timer.check())
{
fly();
break;
}

const float dist = m_catch_pos - m_start_position.y;
const double progress = QuadraticEaseInOut(static_cast<double>(m_timer.get_progress()));
const float value = m_catch_pos - (static_cast<float>(progress) * dist);
const Vector pos(get_pos().x, value);
set_pos(pos);

break;
}

default:
break;
Expand Down

0 comments on commit 15f4294

Please sign in to comment.