X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fbomb.cpp;h=9495abc92a33913cf2f47a6997641ce3ef7ef364;hb=7bbb0ef907ebec48718560425a0147b31307f7fd;hp=6f884f1093270004278c152bfea67a0af9912a0f;hpb=6fe1f3519eecbbb75eca97c45a6697eee36b2442;p=supertux.git diff --git a/src/badguy/bomb.cpp b/src/badguy/bomb.cpp index 6f884f109..9495abc92 100644 --- a/src/badguy/bomb.cpp +++ b/src/badguy/bomb.cpp @@ -9,7 +9,7 @@ Bomb::Bomb(const Vector& pos, Direction dir) { start_position = pos; bbox.set_pos(pos); - bbox.set_size(32, 32); + bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("bomb"); state = 0; timer.start(TICKINGTIME); @@ -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() { } +