afegit so a init_hud
This commit is contained in:
@@ -29,7 +29,8 @@ EscenaJoc::EscenaJoc(SDLManager& sdl, ContextEscenes& context)
|
|||||||
context_(context),
|
context_(context),
|
||||||
debris_manager_(sdl.obte_renderer()),
|
debris_manager_(sdl.obte_renderer()),
|
||||||
gestor_puntuacio_(sdl.obte_renderer()),
|
gestor_puntuacio_(sdl.obte_renderer()),
|
||||||
text_(sdl.obte_renderer()) {
|
text_(sdl.obte_renderer()),
|
||||||
|
init_hud_rect_sound_played_(false) {
|
||||||
// Recuperar configuració de partida des del context
|
// Recuperar configuració de partida des del context
|
||||||
config_partida_ = context_.get_config_partida();
|
config_partida_ = context_.get_config_partida();
|
||||||
|
|
||||||
@@ -198,6 +199,9 @@ void EscenaJoc::inicialitzar() {
|
|||||||
// [ELIMINAT] Iniciar música de joc (ara es gestiona en stage_manager)
|
// [ELIMINAT] Iniciar música de joc (ara es gestiona en stage_manager)
|
||||||
// La música s'inicia quan es transiciona de INIT_HUD a LEVEL_START
|
// La música s'inicia quan es transiciona de INIT_HUD a LEVEL_START
|
||||||
// Audio::get()->playMusic("game.ogg");
|
// Audio::get()->playMusic("game.ogg");
|
||||||
|
|
||||||
|
// Reset flag de sons d'animació
|
||||||
|
init_hud_rect_sound_played_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EscenaJoc::actualitzar(float delta_time) {
|
void EscenaJoc::actualitzar(float delta_time) {
|
||||||
@@ -520,6 +524,12 @@ void EscenaJoc::dibuixar() {
|
|||||||
|
|
||||||
// Dibuixar elements animats
|
// Dibuixar elements animats
|
||||||
if (rect_progress > 0.0f) {
|
if (rect_progress > 0.0f) {
|
||||||
|
// [NOU] Reproduir so quan comença l'animació del rectangle
|
||||||
|
if (!init_hud_rect_sound_played_) {
|
||||||
|
Audio::get()->playSound(Defaults::Sound::LOGO, Audio::Group::GAME);
|
||||||
|
init_hud_rect_sound_played_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
dibuixar_marges_animat(rect_progress);
|
dibuixar_marges_animat(rect_progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,9 @@ class EscenaJoc {
|
|||||||
std::unique_ptr<StageSystem::ConfigSistemaStages> stage_config_;
|
std::unique_ptr<StageSystem::ConfigSistemaStages> stage_config_;
|
||||||
std::unique_ptr<StageSystem::StageManager> stage_manager_;
|
std::unique_ptr<StageSystem::StageManager> stage_manager_;
|
||||||
|
|
||||||
|
// Control de sons d'animació INIT_HUD
|
||||||
|
bool init_hud_rect_sound_played_; // Flag para evitar repetir sonido del rectángulo
|
||||||
|
|
||||||
// Funcions privades
|
// Funcions privades
|
||||||
void tocado(uint8_t player_id);
|
void tocado(uint8_t player_id);
|
||||||
void detectar_col·lisions_bales_enemics(); // Col·lisions bala-enemic
|
void detectar_col·lisions_bales_enemics(); // Col·lisions bala-enemic
|
||||||
|
|||||||
Reference in New Issue
Block a user