Play kill.wav when Tux is killed, hurt.wav when he can keep on playing.
authorwolfgangb <wolfgangb@837edb03-e0f3-0310-88ca-d4d4e8b29345>
Wed, 16 Dec 2009 21:03:21 +0000 (21:03 +0000)
committerwolfgangb <wolfgangb@837edb03-e0f3-0310-88ca-d4d4e8b29345>
Wed, 16 Dec 2009 21:03:21 +0000 (21:03 +0000)
git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6219 837edb03-e0f3-0310-88ca-d4d4e8b29345

src/object/player.cpp

index 11aeef5..a8b7cca 100644 (file)
@@ -161,6 +161,7 @@ Player::Player(PlayerStatus* _player_status, const std::string& name) :
   sound_manager->preload("sounds/bigjump.wav");
   sound_manager->preload("sounds/jump.wav");
   sound_manager->preload("sounds/hurt.wav");
+  sound_manager->preload("sounds/kill.wav");
   sound_manager->preload("sounds/skid.wav");
   sound_manager->preload("sounds/flip.wav");
   sound_manager->preload("sounds/invincible_start.ogg");
@@ -1223,13 +1224,13 @@ Player::kill(bool completely)
 
   growing = false;
 
-  sound_manager->play("sounds/hurt.wav");
-
   if (climbing) stop_climbing(*climbing);
 
   physic.set_velocity_x(0);
 
   if(!completely && is_big()) {
+    sound_manager->play("sounds/hurt.wav");
+
     if(player_status->bonus == FIRE_BONUS
        || player_status->bonus == ICE_BONUS) {
       safe_timer.start(TUX_SAFE_TIME);
@@ -1246,6 +1247,7 @@ Player::kill(bool completely)
       duck = false;
     }
   } else {
+    sound_manager->play("sounds/kill.wav");
 
     // do not die when in edit mode
     if (edit_mode) {