kugelblitz electrifies water on contact - electrified water is baaaaaaad
[supertux.git] / src / badguy / jumpy.cpp
index 7486ffd..9b2a6b7 100644 (file)
@@ -19,7 +19,7 @@
 //  02111-1307, USA.
 #include <config.h>
 
-#include "jumpy.h"
+#include "jumpy.hpp"
 
 static const float JUMPSPEED=600;
 static const float JUMPY_MID_TOLERANCE=4;
@@ -70,7 +70,7 @@ Jumpy::hit(const CollisionHit& chit)
     
     physic.set_velocity_y(JUMPSPEED);
     // TODO create a nice sound for this...
-    //sound_manager->play_sound("skid");
+    //sound_manager->play("sounds/skid.wav");
   } else if(chit.normal.y < .5) { // bumped on roof
     physic.set_velocity_y(0);
   }
@@ -79,12 +79,18 @@ Jumpy::hit(const CollisionHit& chit)
 }
 
 void
-Jumpy::active_action(float elapsed_time)
+Jumpy::active_update(float elapsed_time)
 {
-  BadGuy::active_action(elapsed_time);
+  BadGuy::active_update(elapsed_time);
   
   dir = Sector::current()->player->get_pos().x > get_pos().x
     ? RIGHT : LEFT;
+    
+  if (!groundhit_pos_set)
+  {
+    sprite->set_action(dir == LEFT ? "left-middle" : "right-middle");
+    return;
+  }
   
   if ( get_pos().y < (pos_groundhit.y - JUMPY_MID_TOLERANCE ) )
     sprite->set_action(dir == LEFT ? "left-up" : "right-up");