afegida veu: good job commander

calibrats els volumnes de musica i efectes
afegida forma: ship2.shp
canviat tamany de textos de canvi de pantalla
This commit is contained in:
2025-12-04 18:27:39 +01:00
parent 1dd87c0707
commit 789cbbc593
8 changed files with 38 additions and 9 deletions

View File

@@ -22,7 +22,7 @@ Nau::Nau(SDL_Renderer* renderer)
esta_tocada_(false),
brightness_(Defaults::Brightness::NAU) {
// [NUEVO] Carregar forma compartida des de fitxer
forma_ = Graphics::ShapeLoader::load("ship.shp");
forma_ = Graphics::ShapeLoader::load("ship2.shp");
if (!forma_ || !forma_->es_valida()) {
std::cerr << "[Nau] Error: no s'ha pogut carregar ship.shp" << std::endl;

View File

@@ -244,6 +244,7 @@ void EscenaJoc::actualitzar(float delta_time) {
auto& spawn_ctrl = stage_manager_->get_spawn_controller();
if (spawn_ctrl.tots_enemics_destruits(orni_)) {
stage_manager_->stage_completat();
Audio::get()->playSound(Defaults::Sound::GOOD_JOB_COMMANDER, Audio::Group::GAME);
break;
}
}
@@ -573,8 +574,8 @@ void EscenaJoc::detectar_col·lisio_nau_enemics() {
// [NEW] Stage system helper methods
void EscenaJoc::dibuixar_missatge_stage(const std::string& missatge) {
constexpr float escala = 1.5f;
constexpr float spacing = 3.0f;
constexpr float escala = 1.0f;
constexpr float spacing = 2.0f;
float text_width = text_.get_text_width(missatge, escala, spacing);
float text_height = text_.get_text_height(escala);

View File

@@ -411,7 +411,7 @@ void EscenaTitol::dibuixar() {
return;
}
// Estat MAIN i TRANSITION: Dibuixar títol i text (sobre el starfield)
// Estat MAIN i TRANSITION_TO_GAME: Dibuixar títol i text (sobre el starfield)
if (estat_actual_ == EstatTitol::MAIN || estat_actual_ == EstatTitol::TRANSITION_TO_GAME) {
// === Calcular i renderitzar ombra (només si animació activa) ===
if (animacio_activa_) {
@@ -567,7 +567,8 @@ void EscenaTitol::processar_events(const SDL_Event& event) {
// Iniciar transició amb fade-out de música
estat_actual_ = EstatTitol::TRANSITION_TO_GAME;
temps_acumulat_ = 0.0f; // Reset del comptador
Audio::get()->fadeOutMusic(MUSIC_FADE); // Fade de 300ms
Audio::get()->fadeOutMusic(MUSIC_FADE); // Fade
Audio::get()->playSound(Defaults::Sound::LASER, Audio::Group::GAME);
break;
case EstatTitol::TRANSITION_TO_GAME: