void Totem::kill_fall() { if (carrying) carrying->jump_off(); if (carried_by) jump_off(); BadGuy::kill_fall(); }
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; }
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; }
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; }
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; }
Totem::~Totem() { if (carrying) carrying->jump_off(); if (carried_by) jump_off(); }