5 static const float TICKINGTIME = 1;
6 static const float EXPLOSIONTIME = 1;
8 Bomb::Bomb(const Vector& pos, Direction dir)
12 bbox.set_size(32, 32);
13 sprite = sprite_manager->create("bomb");
15 timer.start(TICKINGTIME);
17 sprite->set_action(dir == LEFT ? "ticking-left" : "ticking-right");
21 Bomb::write(LispWriter& )
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::active_action(float )
51 sprite->set_action("explosion");
52 timer.start(EXPLOSIONTIME);