5 static const float TICKINGTIME = 1;
6 static const float EXPLOSIONTIME = 1;
8 Bomb::Bomb(const Vector& pos, Direction dir)
12 bbox.set_size(31.8, 31.8);
13 sprite = sprite_manager->create("bomb");
15 timer.start(TICKINGTIME);
17 sprite->set_action(dir == LEFT ? "ticking-left" : "ticking-right");
21 Bomb::write(lisp::Writer& )
23 // bombs are only temporarily so don't write them out...
27 Bomb::collision_solid(GameObject& , const CollisionHit& hit)
29 if(fabsf(hit.normal.y) > .5)
30 physic.set_velocity_y(0);
36 Bomb::collision_player(Player& player, const CollisionHit& )
39 player.kill(Player::SHRINK);
45 Bomb::collision_badguy(BadGuy& badguy, const CollisionHit& )
53 Bomb::active_action(float )
59 sprite->set_action("explosion");
60 SoundManager::get()->play_sound(IDToSound(SND_EXPLODE), get_pos(),
61 Sector::current()->player->get_pos());
62 timer.start(EXPLOSIONTIME);