+BadGuy::action_wingling(double elapsed_time)
+{
+ if (dying != DYING_NOT)
+ physic.enable_gravity(true);
+ else
+ {
+ Player& tux = *Sector::current()->player;
+ int dirsign = physic.get_velocity_x() < 0 ? -1 : 1;
+
+ if (fabsf(tux.base.x - base.x) < 150 && base.y < tux.base.y && tux.dying == DYING_NOT)
+ {
+ if (target.x < 0 && target.y < 0)
+ {
+ target.x = tux.base.x;
+ target.y = tux.base.y;
+ physic.set_velocity(dirsign * 1.5f, -2.25f);
+ }
+ }
+ else if (base.y >= target.y - 16)
+ physic.set_velocity(dirsign * WINGLING_FLY_SPEED, 0);
+ }
+
+ physic.apply(elapsed_time, base.x, base.y);
+
+
+ // Handle dying timer:
+ if (dying == DYING_SQUISHED && !timer.check())
+ remove_me();
+
+ // TODO: Winglings should be removed after flying off the screen
+}
+
+void
+BadGuy::action_walkingtree(double elapsed_time)
+{
+ Player& tux = *Sector::current()->player;
+ Direction v_dir = physic.get_velocity_x() < 0 ? LEFT : RIGHT;
+
+ if (dying == DYING_NOT)
+ check_horizontal_bump();
+
+ fall();
+
+ if (mode == BGM_BIG)
+ {
+ if ((tux.base.x + tux.base.width/2 > base.x + base.width/2) && v_dir == LEFT)
+ {
+ dir = RIGHT;
+ physic.set_velocity_x(-physic.get_velocity_x());
+ }
+ else if ((tux.base.x + tux.base.width/2 < base.x + base.width/2) && v_dir == RIGHT)
+ {
+ dir = LEFT;
+ physic.set_velocity_x(-physic.get_velocity_x());
+ }
+ }
+
+
+ physic.apply(elapsed_time, base.x, base.y);
+ if (dying != DYING_FALLING)
+ collision_swept_object_map(&old_base,&base);
+
+ // Handle dying timer:
+ if (dying == DYING_SQUISHED && !timer.check())
+ remove_me();
+}
+
+void