Sprite* smalltux_gameover;
Sprite* smalltux_star;
Sprite* largetux_star;
+Sprite* growingtux_left;
+Sprite* growingtux_right;
PlayerSprite smalltux;
PlayerSprite largetux;
frame_timer.init(true);
kick_timer.init(true);
shooting_timer.init(true);
+ growing_timer.init(true);
physic.reset();
}
skidding_timer.init(true);
safe_timer.init(true);
frame_timer.init(true);
+ growing_timer.init(true);
physic.reset();
}
{
return ( issolid(base.x + base.width / 2, base.y + base.height) ||
issolid(base.x + 1, base.y + base.height) ||
- issolid(base.x + base.width - 1, base.y + base.height) );
+ issolid(base.x + base.width - 1, base.y + base.height) ||
+ isunisolid(base.x + base.width / 2, base.y + base.height) ||
+ isunisolid(base.x + 1, base.y + base.height) ||
+ isunisolid(base.x + base.width - 1, base.y + base.height) );
}
bool
}
void
-Player::grow()
+Player::grow(bool animate)
{
if(size == BIG)
return;
base.height = 64;
base.y -= 32;
+ if(animate)
+ growing_timer.start((int)((growingtux_left->get_frames() / growingtux_left->get_fps()) * 1000));
+
old_base = previous_base = base;
}
}
else
{
- if (duck && size != SMALL)
+ if(growing_timer.check())
+ {
+ if (dir == RIGHT)
+ growingtux_right->draw(pos);
+ else
+ growingtux_left->draw(pos);
+ }
+ else if (duck && size != SMALL)
{
if (dir == RIGHT)
sprite->duck_right->draw(pos);
pplatform_c = (FlyingPlatform*) p_c_object;
base.y = pplatform_c->base.y - base.height;
+ physic.set_velocity_x(pplatform_c->get_vel_x());
+
physic.enable_gravity(false);
+ can_jump = true;
+ fall_mode = ON_GROUND;
break;
default: