- switch (state) {
-
- case STATE_NORMAL:
- if (might_fall()) {
- // turn around when we are at a ledge
- turn_around();
- }
- else if (!turn_recover_timer.started()) {
- // turn around when we see a Bullet
- Sector* sector = Sector::current();
- for (Sector::GameObjects::iterator i = sector->gameobjects.begin(); i != sector->gameobjects.end(); ++i) {
- Bullet* bullet = dynamic_cast<Bullet*>(*i);
- if (bullet) {
- if (can_see(*bullet)) turn_around();
- }
- }
- }
- break;
-
- }
-
- BadGuy::active_update(elapsed_time);
-}
-
-HitResponse
-Igel::collision_solid(GameObject& , const CollisionHit& hit)
-{
- if(fabsf(hit.normal.y) > .5) { // floor or roof
- physic.set_velocity_y(0);
- return CONTINUE;
+ bool wants_to_flee = false;
+
+ // check if we see a fire bullet
+ Sector* sector = Sector::current();
+ for (Sector::GameObjects::iterator i = sector->gameobjects.begin(); i != sector->gameobjects.end(); ++i) {
+ Bullet* bullet = dynamic_cast<Bullet*>(*i);
+ if (!bullet) continue;
+ if (bullet->get_type() != FIRE_BONUS) continue;
+ if (can_see(*bullet)) wants_to_flee = true;