Some Yeti boss work. Yes, you *can* beat it as small tux. (And the secret area *is...
[supertux.git] / src / badguy / yeti_stalactite.cpp
index 59d819b..8f6ef72 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "badguy/yeti_stalactite.hpp"
 
+#include "sprite/sprite.hpp"
 #include "supertux/object_factory.hpp"
 
 static const float YT_SHAKE_TIME = .8f;
@@ -51,4 +52,21 @@ YetiStalactite::active_update(float elapsed_time)
   Stalactite::active_update(elapsed_time);
 }
 
+void
+YetiStalactite::update(float elapsed_time)
+{
+  // Respawn instead of removing once squished
+  if(get_state() == STATE_SQUISHED && check_state_timer()) {
+    set_state(STATE_ACTIVE);
+    state = STALACTITE_HANGING;
+    // Hopefully we shouldn't come into contact with anything...
+    sprite->set_action("normal");
+    set_pos(start_position);
+    set_colgroup_active(COLGROUP_TOUCHABLE);
+  }
+
+  // Call back to badguy to do normal stuff
+  BadGuy::update(elapsed_time);
+}
+
 /* EOF */