Changed Yeti behaviour. You must stun him (jump on him) when is under a falling stala...
[supertux.git] / src / badguy / bomb.cpp
index 66e8348..e6dd34d 100644 (file)
@@ -55,11 +55,7 @@ Bomb::active_action(float )
   switch(state) {
     case 0:
       if(timer.check()) {
-        state = 1;
-        sprite->set_action("explosion");
-        SoundManager::get()->play_sound(IDToSound(SND_EXPLODE), get_pos(),
-            Sector::current()->player->get_pos());
-        timer.start(EXPLOSIONTIME);
+        explode();
       }
       break;
     case 1:
@@ -71,6 +67,18 @@ Bomb::active_action(float )
 }
 
 void
+Bomb::explode()
+{
+  state = 1;
+  sprite->set_action("explosion");
+  SoundManager::get()->play_sound(IDToSound(SND_EXPLODE), get_pos(),
+      Sector::current()->player->get_pos());
+  timer.start(EXPLOSIONTIME);
+}
+
+void
 Bomb::kill_fall()
 {
+  explode();
 }
+