}
// BadGuy fall below the ground
- if (base.y > screen->h) {
+ if (base.y > World::current()->get_level()->height * 32) {
remove_me();
return;
}
+ // Kill us if we landed on spikes
+ if (dying == DYING_NOT
+ && (kind != BAD_STALACTITE && kind != BAD_FLAME && kind != BAD_BOMB)
+ && (isspike(base.x, base.y) || isspike(base.x + base.width, base.y)
+ || isspike(base.x, base.y + base.height)
+ || isspike(base.x + base.width, base.y + base.height)))
+ {
+ physic.set_velocity_y(3);
+ kill_me(0);
+ }
+
// Once it's on screen, it's activated!
if (base.x <= scroll_x + screen->w + OFFSCREEN_DISTANCE)
seen = true;
physic.enable_gravity(true);
/* Gain some points: */
+ if (score != 0)
World::current()->add_score(base.x, base.y,
score * player_status.score_multiplier);
physic.set_velocity_x(fabsf(physic.get_velocity_x()));
// in case badguys get "jammed"
- base.x = pbad_c->base.x + pbad_c->base.width;
+ if (physic.get_velocity_x() != 0)
+ base.x = pbad_c->base.x + pbad_c->base.width;
}
else if (dir == RIGHT)
{