debris hereta brillantor i velocitat
This commit is contained in:
@@ -417,13 +417,18 @@ void EscenaJoc::tocado() {
|
||||
// Create ship explosion
|
||||
const Punt& ship_pos = nau_.get_centre();
|
||||
float ship_angle = nau_.get_angle();
|
||||
Punt vel_nau = nau_.get_velocitat_vector();
|
||||
// Reduir a 80% la velocitat heretada per la nau (més realista)
|
||||
Punt vel_nau_80 = {vel_nau.x * 0.8f, vel_nau.y * 0.8f};
|
||||
|
||||
debris_manager_.explotar(
|
||||
nau_.get_forma(), // Ship shape (3 lines)
|
||||
ship_pos, // Center position
|
||||
ship_angle, // Ship orientation
|
||||
1.0f, // Normal scale
|
||||
Defaults::Physics::Debris::VELOCITAT_BASE // 80 px/s
|
||||
Defaults::Physics::Debris::VELOCITAT_BASE, // 80 px/s
|
||||
nau_.get_brightness(), // Heredar brightness
|
||||
vel_nau_80 // Heredar 60% velocitat
|
||||
);
|
||||
|
||||
// Start death timer (non-zero to avoid re-triggering)
|
||||
@@ -517,12 +522,15 @@ void EscenaJoc::detectar_col·lisions_bales_enemics() {
|
||||
enemic.destruir();
|
||||
|
||||
// 2. Crear explosió de fragments
|
||||
Punt vel_enemic = enemic.get_velocitat_vector();
|
||||
debris_manager_.explotar(
|
||||
enemic.get_forma(), // Forma vectorial del pentàgon
|
||||
pos_enemic, // Posició central
|
||||
0.0f, // Angle (enemic té rotació interna)
|
||||
1.0f, // Escala normal
|
||||
VELOCITAT_EXPLOSIO // 50 px/s (explosió suau)
|
||||
enemic.get_forma(), // Forma vectorial del pentàgon
|
||||
pos_enemic, // Posició central
|
||||
0.0f, // Angle (enemic té rotació interna)
|
||||
1.0f, // Escala normal
|
||||
VELOCITAT_EXPLOSIO, // 50 px/s (explosió suau)
|
||||
enemic.get_brightness(), // Heredar brightness
|
||||
vel_enemic // Heredar velocitat
|
||||
);
|
||||
|
||||
// 3. Desactivar bala
|
||||
|
||||
@@ -240,7 +240,9 @@ void EscenaLogo::actualitzar_explosions(float delta_time) {
|
||||
lletra.posicio, // Posició
|
||||
0.0f, // Angle (sense rotació)
|
||||
ESCALA_FINAL, // Escala (lletres a escala final)
|
||||
VELOCITAT_EXPLOSIO // Velocitat base
|
||||
VELOCITAT_EXPLOSIO, // Velocitat base
|
||||
1.0f, // Brightness màxim (per defecte)
|
||||
{0.0f, 0.0f} // Sense velocitat (per defecte)
|
||||
);
|
||||
|
||||
std::cout << "[EscenaLogo] Explota lletra " << lletra_explosio_index_ << "\n";
|
||||
|
||||
Reference in New Issue
Block a user