X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fbadguy%2Fsnowman.cpp;h=6170ae1f97d81102021e9a57b02a8fa0cab01809;hb=701460d787f5c617e6a03955cf6d736020a0003f;hp=a10951fc7062a079af3095acd441601e530e5a04;hpb=31031c24034f2fc9ac76418efd26a4a984c5bef8;p=supertux.git diff --git a/src/badguy/snowman.cpp b/src/badguy/snowman.cpp index a10951fc7..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,7 +26,7 @@ Snowman::Snowman(const Reader& reader) : WalkingBadguy(reader, "images/creatures/snowman/snowman.sprite", "walk-left", "walk-right") { walk_speed = 40; - sound_manager->preload("sounds/pop.ogg"); + SoundManager::current()->preload("sounds/pop.ogg"); } void @@ -45,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); } @@ -58,7 +59,7 @@ Snowman::collision_bullet(Bullet& bullet, const CollisionHit& hit) // fire bullets destroy snowman's body loose_head(); - sound_manager->play("sounds/pop.ogg", get_pos()); // this could be a different sound + SoundManager::current()->play("sounds/pop.ogg", get_pos()); // this could be a different sound bullet.remove_me(); return ABORT_MOVE; @@ -78,7 +79,7 @@ Snowman::collision_squished(GameObject& object) if (player) player->bounce(*this); - sound_manager->play("sounds/pop.ogg", get_pos()); + SoundManager::current()->play("sounds/pop.ogg", get_pos()); loose_head();