}
Sprite* sprite = (dir == LEFT) ? sprite_left : sprite_right;
- if(dying == DYING_FALLING)
+ if(dying == DYING_FALLING && physic.get_velocity_y() < 0)
sprite->draw(viewport.world2screen(Vector(base.x, base.y)), SD_VERTICAL_FLIP);
else
sprite->draw(viewport.world2screen(Vector(base.x, base.y)));
if(kind == BAD_MRBOMB) {
// mrbomb transforms into a bomb now
- explode();
+ explode(false);
make_player_jump(player);
World::current()->add_score(Vector(base.x, base.y),
}
void
-BadGuy::explode()
+BadGuy::explode(bool right_way)
{
- World::current()->add_bad_guy(base.x, base.y, BAD_BOMB);
+ BadGuy *badguy = World::current()->add_bad_guy(base.x, base.y, BAD_BOMB);
+ if(right_way)
+ {
+ badguy->timer.start(0);
+ badguy->mode = BOMB_TICKING;
+ }
+
remove_me();
}
if (pbad_c->kind == BAD_MRBOMB)
{
// mrbomb transforms into a bomb now
- pbad_c->explode();
+ pbad_c->explode(true);
return;
}
else if (pbad_c->kind != BAD_MRBOMB)
if (pbad_c->kind == BAD_MRBOMB)
{
// mrbomb transforms into a bomb now
- pbad_c->explode();
+ pbad_c->explode(false);
return;
}
else
/** let the player jump a bit (used when you hit a badguy) */
void make_player_jump(Player* player);
- void explode();
+ /** Turn enemy into a bomb. To explode right way pass true */
+ void explode(bool right_away);
/** check if we're running left or right in a wall and eventually change
* direction