play_sound(sounds[SND_FALL], SOUND_CENTER_SPEAKER);
}
+void BadGuy::explode(BadGuy *badguy)
+{
+World::current()->add_bad_guy(badguy->base.x, badguy->base.y, BAD_BOMB);
+badguy->remove_me();
+}
+
void
BadGuy::collision(void *p_c_object, int c_object, CollisionType type)
{
if (pbad_c->kind == BAD_MRBOMB)
{
// mrbomb transforms into a bomb now
- World::current()->add_bad_guy(pbad_c->base.x, pbad_c->base.y,
- BAD_BOMB);
- pbad_c->remove_me();
+ explode(pbad_c);
return;
}
else if (pbad_c->kind != BAD_MRBOMB)
if (pbad_c->kind == BAD_MRBOMB)
{
// mrbomb transforms into a bomb now
- World::current()->add_bad_guy(pbad_c->base.x, pbad_c->base.y,
- BAD_BOMB);
- pbad_c->remove_me();
+ explode(pbad_c);
return;
}
else
}
}
+
//---------------------------------------------------------------------------
void load_badguy_gfx()
void draw();
std::string type() { return "BadGuy"; };
+ void explode(BadGuy* badguy);
+
void collision(void* p_c_object, int c_object,
CollisionType type = COLLISION_NORMAL);