+void
+Kugelblitz::kill_fall()
+{
+}
+
+void
+Kugelblitz::explode()
+{
+ if (!dying) {
+ sprite->set_action("pop");
+ lifetime.start(0.2f);
+ dying = true;
+ }
+ else remove_me();
+}
+
+void
+Kugelblitz::try_activate()
+{
+ //FIXME: Don't activate Kugelblitz before it's on-screen
+ float scroll_x = Sector::current()->camera->get_translation().x;
+ float scroll_y = Sector::current()->camera->get_translation().y;
+
+ /* Activate badguys if they're just around the screen to avoid
+ * the effect of having badguys suddenly popping up from nowhere.
+ */
+ if (start_position.x > scroll_x - X_OFFSCREEN_DISTANCE &&
+ start_position.x < scroll_x - bbox.get_width() &&
+ start_position.y > scroll_y - Y_OFFSCREEN_DISTANCE &&
+ start_position.y < scroll_y + Y_OFFSCREEN_DISTANCE) {
+ dir = RIGHT;
+ set_state(STATE_ACTIVE);
+ activate();
+ } else if (start_position.x > scroll_x &&
+ start_position.x < scroll_x + X_OFFSCREEN_DISTANCE &&
+ start_position.y > scroll_y - Y_OFFSCREEN_DISTANCE &&
+ start_position.y < scroll_y + Y_OFFSCREEN_DISTANCE) {
+ dir = LEFT;
+ set_state(STATE_ACTIVE);
+ activate();
+ } else if (start_position.x > scroll_x - X_OFFSCREEN_DISTANCE &&
+ start_position.x < scroll_x + X_OFFSCREEN_DISTANCE &&
+ ((start_position.y > scroll_y &&
+ start_position.y < scroll_y + Y_OFFSCREEN_DISTANCE) ||
+ (start_position.y > scroll_y - Y_OFFSCREEN_DISTANCE &&
+ start_position.y < scroll_y))) {
+ dir = start_position.x < scroll_x ? RIGHT : LEFT;
+ set_state(STATE_ACTIVE);
+ activate();
+ } else if(state == STATE_INIT
+ && start_position.x > scroll_x - X_OFFSCREEN_DISTANCE
+ && start_position.x < scroll_x + X_OFFSCREEN_DISTANCE
+ && start_position.y > scroll_y - Y_OFFSCREEN_DISTANCE
+ && start_position.y < scroll_y + Y_OFFSCREEN_DISTANCE) {
+ dir = LEFT;
+ set_state(STATE_ACTIVE);
+ activate();
+ }
+}
+