A vore si el helper ja funciona com toca

This commit is contained in:
2024-10-16 13:29:16 +02:00
parent 24556eeaa8
commit 5585f996cb

View File

@@ -77,12 +77,6 @@ Game::Game(int player_id, int current_stage, bool demo, JA_Music_t *music)
background_->setPos(param.game.play_area.rect);
// game_text_sprites_.emplace_back(std::make_shared<SmartSprite>(game_text_textures_.at(0)));
// game_text_sprites_.emplace_back(std::make_shared<SmartSprite>(game_text_textures_.at(1)));
// game_text_sprites_.emplace_back(std::make_shared<SmartSprite>(game_text_textures_.at(2)));
// game_text_sprites_.emplace_back(std::make_shared<SmartSprite>(game_text_textures_.at(3)));
// game_text_sprites_.emplace_back(std::make_shared<SmartSprite>(game_text_textures_.at(4)));
explosions_->addTexture(1, explosions_textures_[0], explosions_animations_[0]);
explosions_->addTexture(2, explosions_textures_[1], explosions_animations_[1]);
explosions_->addTexture(3, explosions_textures_[2], explosions_animations_[2]);
@@ -2280,10 +2274,15 @@ void Game::updateHelper()
// Solo ofrece ayuda cuando la amenaza es elevada
if (menace_current_ > 15)
{
helper_.need_coffee = true;
helper_.need_coffee_machine = true;
for (const auto &player : players_)
{
helper_.need_coffee = (player->getCoffees() == 0);
helper_.need_coffee_machine = (!player->isPowerUp());
if (player->isPlaying())
{
helper_.need_coffee &= (player->getCoffees() == 0);
helper_.need_coffee_machine &= (!player->isPowerUp());
}
}
}
else