Use svnversion program rather than finding the svn package to get revision number
[supertux.git] / src / badguy / jumpy.cpp
index 817e12f..20b3f51 100644 (file)
@@ -26,8 +26,10 @@ static const float JUMPY_MID_TOLERANCE=4;
 static const float JUMPY_LOW_TOLERANCE=2;
 
 Jumpy::Jumpy(const lisp::Lisp& reader)
-    : BadGuy(reader, "images/creatures/jumpy/jumpy.sprite"), groundhit_pos_set(false)
+    : BadGuy(reader, "images/creatures/snowjumpy/snowjumpy.sprite"), groundhit_pos_set(false)
 {
+  // TODO create a nice sound for this...
+  //sound_manager->preload("sounds/skid.wav");
 }
 
 void
@@ -63,11 +65,11 @@ Jumpy::hit(const CollisionHit& chit)
       groundhit_pos_set = true;
     }
 
-    physic.vy = (frozen ? 0 : JUMPSPEED);
+    physic.set_velocity_y((frozen || get_state() == STATE_FALLING) ? 0 : JUMPSPEED);
     // TODO create a nice sound for this...
     //sound_manager->play("sounds/skid.wav");
   } else if(chit.top) {
-    physic.vy = 0;
+    physic.set_velocity_y(0);
   }
 
   return CONTINUE;
@@ -106,7 +108,7 @@ void
 Jumpy::freeze()
 {
   BadGuy::freeze();
-  physic.vy = std::max(0.0f, physic.vy);
+  physic.set_velocity_y(std::max(0.0f, physic.get_velocity_y()));
   sprite->set_action(dir == LEFT ? "left-iced" : "right-iced");
 }