X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fbadguy%2Fsnowman.cpp;h=6170ae1f97d81102021e9a57b02a8fa0cab01809;hb=701460d787f5c617e6a03955cf6d736020a0003f;hp=5cbd5c7b0ec6ad87d8f1b5d7e19478267c910ed7;hpb=dcd6b92996ea0767156f862be11498f1bd44e7c1;p=supertux.git diff --git a/src/badguy/snowman.cpp b/src/badguy/snowman.cpp index 5cbd5c7b0..6170ae1f9 100644 --- a/src/badguy/snowman.cpp +++ b/src/badguy/snowman.cpp @@ -1,5 +1,5 @@ // SuperTux -// Copyright (C) 2010 Ingo Ruhnke +// Copyright (C) 2010 Ingo Ruhnke // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -26,12 +26,7 @@ Snowman::Snowman(const Reader& reader) : WalkingBadguy(reader, "images/creatures/snowman/snowman.sprite", "walk-left", "walk-right") { walk_speed = 40; -} - -Snowman::Snowman(const Vector& pos, Direction d) : - WalkingBadguy(pos, d, "images/creatures/snowman/snowman.sprite", "walk-left", "walk-right") -{ - walk_speed = 40; + SoundManager::current()->preload("sounds/pop.ogg"); } void @@ -50,9 +45,10 @@ Snowman::loose_head() physic.set_acceleration_y(0); physic.enable_gravity(true); set_state (STATE_FALLING); + countMe = false; /* Create a new snowball where the snowman's head was */ - SnowBall* snowball = new SnowBall(snowball_pos, dir, dead_script); + auto snowball = std::make_shared(snowball_pos, dir, dead_script); Sector::current()->add_object(snowball); } @@ -63,8 +59,7 @@ Snowman::collision_bullet(Bullet& bullet, const CollisionHit& hit) // fire bullets destroy snowman's body loose_head(); - // FIXME: the sound used here should differ since there is still a threat - sound_manager->play("sounds/fall.wav", get_pos()); + SoundManager::current()->play("sounds/pop.ogg", get_pos()); // this could be a different sound bullet.remove_me(); return ABORT_MOVE; @@ -84,8 +79,7 @@ Snowman::collision_squished(GameObject& object) if (player) player->bounce(*this); - // FIXME: the squish sound isn't best here - sound_manager->play("sounds/squish.wav", get_pos()); + SoundManager::current()->play("sounds/pop.ogg", get_pos()); loose_head();