fade out console
[supertux.git] / src / badguy / badguy.cpp
index 4290404..aa772a2 100644 (file)
 #include "tile.hpp"
 #include "statistics.hpp"
 #include "game_session.hpp"
-#include "msg.hpp"
+#include "log.hpp"
 
 static const float SQUISH_TIME = 2;
 static const float X_OFFSCREEN_DISTANCE = 1600;
 static const float Y_OFFSCREEN_DISTANCE = 1200;
 
 BadGuy::BadGuy()
-  : countMe(true), sprite(0), dir(LEFT), state(STATE_INIT)
+  : countMe(true), sprite(0), remove_out_of_bounds(true), dir(LEFT), state(STATE_INIT)
 {
   set_group(COLGROUP_DISABLED);
 }
@@ -62,7 +62,7 @@ BadGuy::draw(DrawingContext& context)
 void
 BadGuy::update(float elapsed_time)
 {
-  if(!Sector::current()->inside(bbox)) {
+  if(!Sector::current()->inside(bbox) && remove_out_of_bounds) {
     remove_me();
     return;
   }
@@ -105,7 +105,7 @@ BadGuy::deactivate()
 void
 BadGuy::save(lisp::Writer& )
 {
-       msg_warning << "tried to write out a generic badguy" << std::endl;
+       log_warning << "tried to write out a generic badguy" << std::endl;
 }
 
 void