debris hereten velocitat angular

This commit is contained in:
2025-12-09 12:30:03 +01:00
parent 523342fed9
commit 3c3857c1b2
6 changed files with 93 additions and 18 deletions

View File

@@ -483,7 +483,9 @@ void EscenaJoc::tocado() {
1.0f, // Normal scale
Defaults::Physics::Debris::VELOCITAT_BASE, // 80 px/s
nau_.get_brightness(), // Heredar brightness
vel_nau_80 // Heredar 80% velocitat
vel_nau_80, // Heredar 80% velocitat
0.0f, // Nave: trayectorias rectas (sin drotacio)
0.0f // Sin herencia visual (rotación aleatoria)
);
// Start death timer (non-zero to avoid re-triggering)
@@ -546,7 +548,7 @@ void EscenaJoc::detectar_col·lisions_bales_enemics() {
constexpr float SUMA_RADIS_QUADRAT = SUMA_RADIS * SUMA_RADIS; // 826.56
// Velocitat d'explosió reduïda per efecte suau
constexpr float VELOCITAT_EXPLOSIO = 50.0f; // px/s (en lloc de 80.0f per defecte)
constexpr float VELOCITAT_EXPLOSIO = 80.0f; // px/s (en lloc de 80.0f per defecte)
// Iterar per totes les bales actives
for (auto& bala : bales_) {
@@ -590,7 +592,9 @@ void EscenaJoc::detectar_col·lisions_bales_enemics() {
1.0f, // Escala normal
VELOCITAT_EXPLOSIO, // 50 px/s (explosió suau)
enemic.get_brightness(), // Heredar brightness
vel_enemic // Heredar velocitat
vel_enemic, // Heredar velocitat
enemic.get_drotacio(), // Heredar velocitat angular (trayectorias curvas)
0.0f // Sin herencia visual (rotación aleatoria)
);
// 3. Desactivar bala