+#endif
+
+ if (push) {
+ Vector center = get_bbox ().get_middle ();
+ std::vector<MovingObject*> near_objects = Sector::current()->get_nearby_objects (center, 10.0 * 32.0);
+
+ for (size_t i = 0; i < near_objects.size (); i++) {
+ MovingObject *obj = near_objects[i];
+ Vector obj_vector = obj->get_bbox ().get_middle ();
+ Vector direction = obj_vector - center;
+ float distance = direction.norm ();
+
+ /* If the distance is very small, for example because "obj" is the badguy
+ * causing the explosion, skip this object. */
+ if (distance <= 1.0)
+ continue;
+
+ /* The force decreases with the distance squared. In the distance of one
+ * tile (32 pixels) you will have a speed increase of 150 pixels/s. */
+ float force = 150.0 * 32.0*32.0 / (distance * distance);
+ if (force > 200.0)
+ force = 200.0;
+
+ Vector add_speed = direction.unit () * force;
+
+ Player *player = dynamic_cast<Player *> (obj);
+ if (player) {
+ player->add_velocity (add_speed);
+ }
+
+ WalkingBadguy *badguy = dynamic_cast<WalkingBadguy *> (obj);
+ if (badguy) {
+ badguy->add_velocity (add_speed);
+ }
+ } /* for (i = 0 ... near_objects) */
+ } /* if (push) */