Fix: mil minibugs relacionats amb el audio
This commit is contained in:
@@ -69,6 +69,8 @@ Game::Game(int player_id, int current_stage, bool demo)
|
||||
fade_in_->setType(FadeType::VENETIAN);
|
||||
fade_in_->setMode(FadeMode::IN);
|
||||
fade_in_->activate();
|
||||
// JA_PlaySound(Resource::get()->getSound("fade_in.wav"));
|
||||
// playMusic();
|
||||
|
||||
fade_out_->setColor(fade_color.r, fade_color.g, fade_color.b);
|
||||
fade_out_->setPost(param.fade.post_duration);
|
||||
@@ -98,9 +100,9 @@ Game::Game(int player_id, int current_stage, bool demo)
|
||||
|
||||
Game::~Game()
|
||||
{
|
||||
// Guarda las puntuaciones en un fichero
|
||||
if (!demo_.enabled)
|
||||
{
|
||||
// Guarda las puntuaciones en un fichero
|
||||
auto manager = std::make_unique<ManageHiScoreTable>(options.game.hi_score_table);
|
||||
manager->saveToFile(asset_->get("score.bin"));
|
||||
}
|
||||
@@ -109,6 +111,7 @@ Game::~Game()
|
||||
// Habilita los sonidos
|
||||
JA_EnableSound(true);
|
||||
}
|
||||
|
||||
#ifdef RECORDING
|
||||
saveDemoFile(Asset::get()->get("demo1.bin"), demo_.data.at(0));
|
||||
#endif
|
||||
@@ -294,6 +297,7 @@ void Game::updateFadeInState()
|
||||
balloon_manager_->createTwoBigBalloons();
|
||||
evaluateAndSetMenace();
|
||||
createMessage({paths_.at(0), paths_.at(1)}, Resource::get()->getTexture("get_ready"));
|
||||
JA_PlaySound(Resource::get()->getSound("stage_change.wav"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -309,7 +313,8 @@ void Game::updateGameOverState()
|
||||
if (game_over_counter_ == GAME_OVER_COUNTER_)
|
||||
{
|
||||
createMessage({paths_.at(2), paths_.at(3)}, Resource::get()->getTexture("game_over"));
|
||||
stopMusic();
|
||||
// stopMusic();
|
||||
JA_FadeOutMusic(1000);
|
||||
balloon_manager_->setSounds(true);
|
||||
}
|
||||
|
||||
@@ -986,7 +991,11 @@ void Game::disableTimeStopItem()
|
||||
void Game::checkMusicStatus()
|
||||
{
|
||||
// Si se ha completado el juego o los jugadores han terminado, detiene la música
|
||||
state_ == GameState::FADE_IN || state_ == GameState::COMPLETED || allPlayersAreGameOver() ? stopMusic() : playMusic();
|
||||
// state_ == GameState::FADE_IN || state_ == GameState::COMPLETED || allPlayersAreGameOver() ? stopMusic() : playMusic();
|
||||
if (state_ != GameState::COMPLETED && !allPlayersAreGameOver())
|
||||
{
|
||||
playMusic();
|
||||
}
|
||||
}
|
||||
|
||||
// Bucle para el juego
|
||||
|
||||
@@ -257,13 +257,16 @@ void Title::checkInput()
|
||||
{
|
||||
if (section::options == section::Options::TITLE_2 || ALLOW_TITLE_ANIMATION_SKIP)
|
||||
{
|
||||
fade_->activate();
|
||||
JA_FadeOutMusic(1500);
|
||||
if (!fade_->isEnabled())
|
||||
{
|
||||
JA_PlaySound(Resource::get()->getSound("game_start.wav"));
|
||||
JA_FadeOutMusic(1500);
|
||||
fade_->activate();
|
||||
post_fade_ = controller.player_id;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Comprueba si se va a intercambiar la asignación de mandos a jugadores
|
||||
if (Input::get()->checkInput(InputType::SERVICE, INPUT_ALLOW_REPEAT, controller.type, controller.index) &&
|
||||
|
||||
Reference in New Issue
Block a user