millorat el spawn d'enemics: perimetre de seguretat i animació amb invulnerabilitat
This commit is contained in:
@@ -129,6 +129,9 @@ void EscenaJoc::inicialitzar() {
|
||||
stage_manager_ = std::make_unique<StageSystem::StageManager>(stage_config_.get());
|
||||
stage_manager_->inicialitzar();
|
||||
|
||||
// [NEW] Set ship position reference for safe spawn
|
||||
stage_manager_->get_spawn_controller().set_ship_position(&nau_.get_centre());
|
||||
|
||||
// Inicialitzar estat de col·lisió
|
||||
itocado_ = 0;
|
||||
|
||||
@@ -428,7 +431,7 @@ void EscenaJoc::tocado() {
|
||||
1.0f, // Normal scale
|
||||
Defaults::Physics::Debris::VELOCITAT_BASE, // 80 px/s
|
||||
nau_.get_brightness(), // Heredar brightness
|
||||
vel_nau_80 // Heredar 60% velocitat
|
||||
vel_nau_80 // Heredar 80% velocitat
|
||||
);
|
||||
|
||||
// Start death timer (non-zero to avoid re-triggering)
|
||||
@@ -507,6 +510,11 @@ void EscenaJoc::detectar_col·lisions_bales_enemics() {
|
||||
continue;
|
||||
}
|
||||
|
||||
// [NEW] Skip collision if enemy is invulnerable
|
||||
if (enemic.es_invulnerable()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const Punt& pos_enemic = enemic.get_centre();
|
||||
|
||||
// Calcular distància quadrada (evita sqrt)
|
||||
@@ -564,6 +572,11 @@ void EscenaJoc::detectar_col·lisio_nau_enemics() {
|
||||
continue;
|
||||
}
|
||||
|
||||
// [NEW] Skip collision if enemy is invulnerable
|
||||
if (enemic.es_invulnerable()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const Punt& pos_enemic = enemic.get_centre();
|
||||
|
||||
// Calculate squared distance (avoid sqrt)
|
||||
|
||||
Reference in New Issue
Block a user