Hardcoded stay-on-platform behaviour as follows: Mr. Bomb, Mr. Tree and the Totem...
[supertux.git] / src / badguy / snowball.cpp
index 63e1246..1c2e6b6 100644 (file)
@@ -30,19 +30,16 @@ SnowBall::SnowBall(const lisp::Lisp& reader)
   //This is for a hidden badguy :)
   fluffy = false;  
   reader.get("fluffy",fluffy);
-  stay_on_platform = false;
-  reader.get("stay-on-platform", stay_on_platform);
   bbox.set_size(31.8, 31.8);
   if (fluffy) sprite = sprite_manager->create("images/creatures/fluffy/fluffy.sprite");
   else sprite = sprite_manager->create("images/creatures/snowball/snowball.sprite");
   set_direction = false;
 }
 
-SnowBall::SnowBall(float pos_x, float pos_y, Direction d, bool stay_on_plat = false)
+SnowBall::SnowBall(float pos_x, float pos_y, Direction d)
 {
   start_position.x = pos_x;
   start_position.y = pos_y;
-  stay_on_platform = stay_on_plat;
   bbox.set_size(31.8, 31.8);
   sprite = sprite_manager->create("images/creatures/snowball/snowball.sprite");
   set_direction = true;
@@ -61,9 +58,6 @@ SnowBall::write(lisp::Writer& writer)
     writer.write_bool("fluffy", true);
   }
 
-  if (stay_on_platform)
-    writer.write_bool("stay-on-platform", true);
-
   writer.end_list("snowball");
 }
 
@@ -75,19 +69,6 @@ SnowBall::activate()
   sprite->set_action(dir == LEFT ? "left" : "right");
 }
 
-void
-SnowBall::active_update(float elapsed_time)
-{
-  BadGuy::active_update(elapsed_time);
-
-  if (stay_on_platform && may_fall_off_platform())
-  {
-    dir = (dir == LEFT ? RIGHT : LEFT);
-    sprite->set_action(dir == LEFT ? "left" : "right");
-    physic.set_velocity_x(-physic.get_velocity_x());
-  }
-}
-
 bool
 SnowBall::collision_squished(Player& player)
 {