#define TILES_FOR_BUTTJUMP 3
// animation times (in ms):
#define SHOOTING_TIME 320
+#define STOMP_TIME 250
// others stuff:
#define AUTOSCROLL_DEAD_INTERVAL 300
jumping = false;
can_jump = true;
butt_jump = false;
-
+
+ stomp_pos = Vector(0,0);
frame_main = 0;
frame_ = 0;
if (isbrick(base.x, base.y) ||
isfullbox(base.x, base.y))
{
- Sector::current()->trygrabdistro(
+ Sector::current()->trygrabdistro(
Vector(base.x, base.y - 32), BOUNCE);
Sector::current()->trybumpbadguy(Vector(base.x, base.y - 64));
if (isbrick(base.x+ 31, base.y) ||
isfullbox(base.x+ 31, base.y))
{
- Sector::current()->trygrabdistro(
+ Sector::current()->trygrabdistro(
Vector(base.x+ 31, base.y - 32), BOUNCE);
Sector::current()->trybumpbadguy(Vector(base.x+ 31, base.y - 64));
// Do butt jump
if (butt_jump && on_ground() && size == BIG)
{
+
+ if (duck)
+ stomp_pos = Vector(base.x - 32, base.y);
+ else
+ stomp_pos = Vector(base.x - 32, base.y + 32);
+ stomp_timer.start(STOMP_TIME);
+
butt_jump = false;
// Break bricks beneath Tux
{
Sector::current()->trygrabdistro(Vector(base.x, base.y), NO_BOUNCE);
Sector::current()->trygrabdistro(Vector(base.x+ 31, base.y), NO_BOUNCE);
-
Sector::current()->trygrabdistro(
Vector(base.x, base.y + base.height), NO_BOUNCE);
Sector::current()->trygrabdistro(
if(size == BIG)
{
- Sector::current()->trygrabdistro(
+ Sector::current()->trygrabdistro(
Vector(base.x, base.y + base.height / 2), NO_BOUNCE);
Sector::current()->trygrabdistro(
Vector(base.x+ 31, base.y + base.height / 2), NO_BOUNCE);
{
if (dying == DYING_SQUISHED)
{
- smalltux_gameover->draw(context, pos, LAYER_OBJECTS+1);
+ smalltux_gameover->draw(context, pos, LAYER_FOREGROUNDTILES+1);
}
else
{
else
sprite->grab_left->draw(context, pos, LAYER_OBJECTS + 1);
}
+
+ // Draw stomp clouds when doing a butt jump
+ if (stomp_timer.check())
+ sprite->stomp->draw(context, stomp_pos, LAYER_OBJECTS + 1);
// Draw blinking star overlay
if (invincible_timer.started() &&