X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fplayer.cpp;h=a049774fc1a79fb78168487a970641ff918e6b59;hb=3369ed08e4b7126af560dc5f9c3442fc76b43ab4;hp=d5f6121495c60ec202ea7173699ade3c23bfb21d;hpb=797d2906f91cf8097f8d4c542753ccfd5a9b8350;p=supertux.git diff --git a/src/player.cpp b/src/player.cpp index d5f612149..a049774fc 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -39,6 +39,7 @@ #define TILES_FOR_BUTTJUMP 3 // animation times (in ms): #define SHOOTING_TIME 320 +#define STOMP_TIME 250 // others stuff: #define AUTOSCROLL_DEAD_INTERVAL 300 @@ -507,6 +508,7 @@ Player::handle_vertical_input() // Do butt jump if (butt_jump && on_ground() && size == BIG) { + stomp_timer.start(STOMP_TIME); butt_jump = false; // Break bricks beneath Tux @@ -528,8 +530,9 @@ Player::handle_vertical_input() BadGuy* badguy = dynamic_cast (*i); if(badguy) { - if (fabsf(base.x - badguy->base.x) < 300 && - fabsf(base.y - badguy->base.y) < 300 && + + if (fabsf(base.x - badguy->base.x) < 150 && + fabsf(base.y - badguy->base.y) < 60 && (issolid(badguy->base.x + 1, badguy->base.y + badguy->base.height) || issolid(badguy->base.x + badguy->base.width - 1, badguy->base.y + badguy->base.height))) badguy->kill_me(25); @@ -763,6 +766,13 @@ Player::draw(DrawingContext& context) else sprite->grab_left->draw(context, pos, LAYER_OBJECTS + 1); } + + // Draw stomp clouds when doing a butt jump + if (stomp_timer.check()) + if (duck) + sprite->stomp->draw(context, Vector(base.x - 32, base.y), LAYER_OBJECTS + 1); + else + sprite->stomp->draw(context, Vector(base.x - 32, base.y + 32), LAYER_OBJECTS + 1); // Draw blinking star overlay if (invincible_timer.started() &&