X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fbomb.cpp;h=9495abc92a33913cf2f47a6997641ce3ef7ef364;hb=7bbb0ef907ebec48718560425a0147b31307f7fd;hp=62547b9e9bf4df181d4b7ff70e57ddc413110f51;hpb=a705cb038b55f5d7634c646c134abaa7d16aee2b;p=supertux.git diff --git a/src/badguy/bomb.cpp b/src/badguy/bomb.cpp index 62547b9e9..9495abc92 100644 --- a/src/badguy/bomb.cpp +++ b/src/badguy/bomb.cpp @@ -18,7 +18,7 @@ Bomb::Bomb(const Vector& pos, Direction dir) } void -Bomb::write(LispWriter& ) +Bomb::write(lisp::Writer& ) { // bombs are only temporarily so don't write them out... } @@ -41,6 +41,14 @@ Bomb::collision_player(Player& player, const CollisionHit& ) return ABORT_MOVE; } +HitResponse +Bomb::collision_badguy(BadGuy& badguy, const CollisionHit& ) +{ + if(state == 1) + badguy.kill_fall(); + return ABORT_MOVE; +} + void Bomb::active_action(float ) { @@ -49,6 +57,8 @@ Bomb::active_action(float ) if(timer.check()) { state = 1; sprite->set_action("explosion"); + SoundManager::get()->play_sound(IDToSound(SND_EXPLODE), get_pos(), + Sector::current()->player->get_pos()); timer.start(EXPLOSIONTIME); } break; @@ -64,3 +74,4 @@ void Bomb::kill_fall() { } +