#define TILES_FOR_BUTTJUMP 3
// animation times (in ms):
#define SHOOTING_TIME 320
+#define STOMP_TIME 250
// others stuff:
#define AUTOSCROLL_DEAD_INTERVAL 300
/* In case the player has pressed Down while in a certain range of air,
enable butt jump action */
- if (input.down == DOWN && !butt_jump)
+ if (input.down == DOWN && !butt_jump && !duck)
if(tiles_on_air(TILES_FOR_BUTTJUMP) && jumping)
butt_jump = true;
// Do butt jump
if (butt_jump && on_ground() && size == BIG)
{
+ stomp_timer.start(STOMP_TIME);
butt_jump = false;
// Break bricks beneath Tux
BadGuy* badguy = dynamic_cast<BadGuy*> (*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);
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() &&