3 #include "rocketexplosion.h"
5 static const float EXPLOSIONTIME = 1;
7 RocketExplosion::RocketExplosion(const Vector& pos, Direction dir)
11 bbox.set_size(31.8, 31.8);
12 sprite = sprite_manager->create("rocketexplosion");
18 RocketExplosion::write(lisp::Writer& )
20 // bombs are only temporarily so don't write them out...
24 RocketExplosion::collision_solid(GameObject& , const CollisionHit& hit)
26 if(fabsf(hit.normal.y) > .5)
27 physic.set_velocity_y(0);
33 RocketExplosion::collision_player(Player& player, const CollisionHit& )
35 player.kill(Player::SHRINK);
40 RocketExplosion::collision_badguy(BadGuy& badguy, const CollisionHit& )
47 RocketExplosion::active_action(float elapsed_time)
55 RocketExplosion::explode()
57 sprite->set_action(dir == LEFT ? "explosion-left" : "explosion-right");
58 SoundManager::get()->play_sound(IDToSound(SND_EXPLODE), get_pos(),
59 Sector::current()->player->get_pos());
60 timer.start(EXPLOSIONTIME, true);
64 RocketExplosion::kill_fall()