if (on_ground())
{
// jump higher if we are running
- if (physic.get_velocity_x() > MAX_WALK_XM)
+ if (fabs(physic.get_velocity_x()) > MAX_WALK_XM)
physic.set_velocity_y(5.8);
else
physic.set_velocity_y(5.2);
}
// Draw blinking star overlay
- if (invincible_timer.started() && (invincible_timer.get_left() > TUX_INVINCIBLE_TIME_WARNING || global_frame_counter % 2))
+ if (invincible_timer.started() &&
+ (invincible_timer.get_left() > TUX_INVINCIBLE_TIME_WARNING || global_frame_counter % 3))
{
if (size == SMALL || duck)
smalltux_star->draw(base.x - scroll_x, base.y);