Ejemplo n.º 1
0
void
Totem::kill_fall()
{
  if (carrying) carrying->jump_off();
  if (carried_by) jump_off();

  BadGuy::kill_fall();
}
Ejemplo n.º 2
0
bool
Totem::collision_squished(Player& player)
{
  if (carrying) carrying->jump_off();
  if (carried_by) {
    player.bounce(*this);
    jump_off();
  }

  sprite->set_action(dir == LEFT ? "squished-left" : "squished-right");
  this->bbox.set_size(48, 45);
  kill_squished(player);
  return true;
}
Ejemplo n.º 3
0
bool
Totem::collision_squished(Player& player)
{
  if (carrying) carrying->jump_off();
  if (carried_by) {
    player.bounce(*this);
    jump_off();
  }

  sprite->set_action(dir == LEFT ? "squished-left" : "squished-right");
  bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());

  kill_squished(player);
  return true;
}
Ejemplo n.º 4
0
bool
Totem::collision_squished(GameObject& object)
{
  if (carrying) carrying->jump_off();
  if (carried_by) {
    Player* player = dynamic_cast<Player*>(&object);
    if (player) player->bounce(*this);
    jump_off();
  }

  sprite->set_action(dir == LEFT ? "squished-left" : "squished-right");
  bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());

  kill_squished(object);
  return true;
}
Ejemplo n.º 5
0
bool
Totem::collision_squished(GameObject& object)
{
  /// Tux shouldn't be able to bisect totem stack by sacrificing his powerup.
  /// --Hume2
  if (carrying) {
    return false;
  }

  if (carried_by) {
    Player* player = dynamic_cast<Player*>(&object);
    if (player) player->bounce(*this);
    jump_off();
  }

  sprite->set_action(dir == LEFT ? "squished-left" : "squished-right");
  bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());

  kill_squished(object);
  return true;
}
Ejemplo n.º 6
0
Totem::~Totem()
{
  if (carrying) carrying->jump_off();
  if (carried_by) jump_off();
}