{ /* FIXME: The pbad object shouldn't know about pplayer objects. */
/* If we're holding the iceblock */
dir = tux.dir;
- if(dir==RIGHT)
+ if(tux.size == SMALL)
{
- base.x = tux.base.x + 16;
- base.y = tux.base.y + tux.base.height/1.5 - base.height;
+ if(dir == RIGHT)
+ base.x = tux.base.x + 24;
+ else // dir == LEFT
+ base.x = tux.base.x - 12;
+ base.y = tux.base.y + tux.base.height/1.5 - base.height;
}
- else /* facing left */
+ else // TUX == BIG
{
- base.x = tux.base.x - 16;
- base.y = tux.base.y + tux.base.height/1.5 - base.height;
+ if(dir == RIGHT)
+ base.x = tux.base.x + 24;
+ else // dir == LEFT
+ base.x = tux.base.x - 4;
+ base.y = tux.base.y + tux.base.height/1.5 - base.height;
}
+
if(collision_object_map(base))
{
base.x = tux.base.x;
if(tux.input.fire != DOWN) /* SHOOT! */
{
if(dir == LEFT)
- base.x -= 24;
+ base.x = tux.base.x - base.width;
else
- base.x += 24;
+ base.x = tux.base.x + tux.base.width;
old_base = base;
mode=KICK;
BadGuy::check_horizontal_bump(bool checkcliff)
{
float halfheight = base.height / 2;
- if (dir == LEFT && issolid( base.x, (int) base.y + halfheight))
+ if (dir == LEFT && issolid( base.x, base.y + halfheight))
{
if (kind == BAD_MRICEBLOCK && mode == KICK)
+ {
Sector::current()->trybreakbrick(Vector(base.x, base.y + halfheight), false);
+ Sector::current()->tryemptybox(Vector(base.x, base.y + halfheight), dir);
+ }
dir = RIGHT;
physic.set_velocity(-physic.get_velocity_x(), physic.get_velocity_y());
return;
}
- if (dir == RIGHT && issolid( base.x + base.width, (int)base.y + halfheight))
+ if (dir == RIGHT && issolid( base.x + base.width, base.y + halfheight))
{
if (kind == BAD_MRICEBLOCK && mode == KICK)
+ {
Sector::current()->trybreakbrick(
- Vector(base.x + base.width, (int) base.y + halfheight), false);
+ Vector(base.x + base.width, base.y + halfheight), false);
+ Sector::current()->tryemptybox(
+ Vector(base.x + base.width, base.y + halfheight), dir);
+ }
dir = LEFT;
physic.set_velocity(-physic.get_velocity_x(), physic.get_velocity_y());
player->bounce(this);
Sector::current()->add_score(Vector(base.x, base.y),
- 50 * player_status.score_multiplier);
+ 25 * player_status.score_multiplier);
SoundManager::get()->play_sound(IDToSound(SND_SQUISH), get_pos(), Sector::current()->player->get_pos());
player_status.score_multiplier++;
player->bounce(this);
Sector::current()->add_score(Vector(base.x, base.y),
- 50 * player_status.score_multiplier);
+ 25 * player_status.score_multiplier);
SoundManager::get()->play_sound(IDToSound(SND_SQUISH), get_pos(), Sector::current()->player->get_pos());
player_status.score_multiplier++;
return;
pbad_c->explode(true);
return;
}
- else if (pbad_c->kind != BAD_MRBOMB)
+ else
{
pbad_c->kill_me(50);
}
// Put bad guys a part (or they get jammed)
// only needed to do to one of them
- base.x = pbad_c->base.x + pbad_c->base.width + 1;
+ if (physic.get_velocity_x() != 0)
+ base.x = pbad_c->base.x + pbad_c->base.width + 1;
}
else if (dir == RIGHT)
{