void
BadGuy::squish_me(Player* player)
{
- player->bounce();
+ player->bounce(this);
Sector::current()->add_score(Vector(base.x, base.y),
50 * player_status.score_multiplier);
// mrbomb transforms into a bomb now
explode(false);
- player->bounce();
+ player->bounce(this);
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);
}
- player->bounce();
+ player->bounce(this);
player_status.score_multiplier++;
if(physic.get_velocity_y() >= 0)
return;
- player->bounce();
+ player->bounce(this);
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
- player->bounce();
+ player->bounce(this);
base.y += 66 - base.height;
Sector::current()->add_score(Vector(base.x, base.y),
}
void
-Player::bounce()
+Player::bounce(BadGuy* badguy)
{
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;
+ // Move the player a little bit above the badguy to avoid collision
+ // between badguy and player directly after the bounce has happend
+ base.y = badguy->base.y - base.height - 2;
}
/* EOF */
#include "moving_object.h"
#include "physic.h"
+class BadGuy;
+
/* Times: */
#define TUX_SAFE_TIME 1250
/** let the player jump a bit or more if jump button is hold down
(used when you hit a badguy) */
- void bounce();
+ void bounce(BadGuy* badguy);
bool is_dead() const
{ return dead; }