}
void
-BadGuy::make_player_jump(Player* player)
-{
- player->physic.set_velocity_y(2);
- player->base.y = base.y - player->base.height - 2;
-}
-
-void
BadGuy::squish_me(Player* player)
{
- make_player_jump(player);
+ player->bounce();
Sector::current()->add_score(Vector(base.x, base.y),
50 * player_status.score_multiplier);
// mrbomb transforms into a bomb now
explode(false);
- make_player_jump(player);
+ player->bounce();
Sector::current()->add_score(Vector(base.x, base.y),
50 * player_status.score_multiplier);
sound_manager->play_sound(sounds[SND_SQUISH], get_pos());
set_sprite(img_mriceblock_flat_left, img_mriceblock_flat_right);
}
- make_player_jump(player);
+ player->bounce();
player_status.score_multiplier++;
if(physic.get_velocity_y() >= 0)
return;
- make_player_jump(player);
+ player->bounce();
Sector::current()->add_score(Vector(base.x, base.y),
25 * player_status.score_multiplier);
physic.set_velocity_x(physic.get_velocity_x() * 2.0f);
// XXX magic number: 66 is BGM_BIG height
- make_player_jump(player);
+ player->bounce();
base.y += 66 - base.height;
Sector::current()->add_score(Vector(base.x, base.y),
}
}
+void
+Player::bounce()
+{
+ if (input.up)
+ physic.set_velocity_y(5.2);
+ else
+ physic.set_velocity_y(2);
+
+ // FIXME: moving tux up looks ugly, but without it tux might collide
+ // FIXME: with enemies, which he has just jump onto (iceblock)
+ //base.y = base.y - base.height - 2;
+}
+
+/* EOF */
+