X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy.cpp;h=c74e6779b6c02a4c82139b7a32574b7c0d9aa5ac;hb=9be8218763c8956455cea3c362c19f35916384f3;hp=d2fe17db87e4ec80dc47ebd629de3b43b134b45b;hpb=4102935c5b9ef122f14e1ef90c900d24728dbef9;p=supertux.git diff --git a/src/badguy.cpp b/src/badguy.cpp index d2fe17db8..c74e6779b 100644 --- a/src/badguy.cpp +++ b/src/badguy.cpp @@ -714,11 +714,22 @@ BadGuy::action(double frame_ratio) } // 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; @@ -965,6 +976,7 @@ BadGuy::kill_me(int score) physic.enable_gravity(true); /* Gain some points: */ + if (score != 0) World::current()->add_score(base.x, base.y, score * player_status.score_multiplier);