void
Player::handle_vertical_input()
{
- if(input.up == DOWN)
+ if(input.up == DOWN && input.old_up == UP)
{
if (on_ground())
{
{
handle_vertical_input();
}
+ input.old_up = input.up;
/* Shoot! */
duck = false;
base.y -= 32;
base.height = 64;
- old_base = previous_base = base;
+ // changing base size confuses collision otherwise
+ old_base = previous_base = base;
}
}
void
+Player::grow()
+{
+ if(size == BIG)
+ return;
+
+ size = BIG;
+ base.height = 64;
+ base.y -= 32;
+
+ old_base = previous_base = base;
+}
+
+void
Player::grabdistros()
{
/* Grab distros: */
else
sprite = &largetux;
- if (duck)
+ if (duck && size != SMALL)
{
if (dir == RIGHT)
sprite->duck_right->draw(base.x - scroll_x, base.y);
else
sprite->duck_left->draw(base.x - scroll_x, base.y);
- }
+ }
else if (skidding_timer.started())
{
if (dir == RIGHT)
!safe_timer.started() &&
pbad_c->mode != BadGuy::HELD)
{
- if (pbad_c->mode == BadGuy::FLAT && input.fire == DOWN)
+ if (pbad_c->mode == BadGuy::FLAT && input.fire == DOWN
+ && !holding_something)
{
holding_something = true;
pbad_c->mode = BadGuy::HELD;
}
else
{
- pbad_c->kill_me();
+ pbad_c->kill_me(25);
}
}
player_status.score_multiplier++;