delay en naus en titol
This commit is contained in:
@@ -101,6 +101,32 @@ void ShipAnimator::trigger_exit_animation() {
|
||||
}
|
||||
}
|
||||
|
||||
void ShipAnimator::skip_to_floating_state() {
|
||||
// Posar ambdues naus directament en estat FLOATING
|
||||
for (auto& nau : naus_) {
|
||||
nau.estat = EstatNau::FLOATING;
|
||||
nau.temps_estat = 0.0f;
|
||||
nau.fase_oscilacio = 0.0f;
|
||||
|
||||
// Posar en posició objectiu (sense animació)
|
||||
nau.posicio_actual = nau.posicio_objectiu;
|
||||
nau.escala_actual = nau.escala_objectiu;
|
||||
|
||||
// NO establir visibilitat aquí - ja ho fa el caller
|
||||
// (evita fer visibles ambdues naus quan només una ha premut START)
|
||||
}
|
||||
}
|
||||
|
||||
bool ShipAnimator::is_visible() const {
|
||||
// Retorna true si almenys una nau és visible
|
||||
for (const auto& nau : naus_) {
|
||||
if (nau.visible) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ShipAnimator::trigger_exit_animation_for_player(int jugador_id) {
|
||||
// Trobar la nau del jugador especificat
|
||||
for (auto& nau : naus_) {
|
||||
|
||||
@@ -73,10 +73,12 @@ class ShipAnimator {
|
||||
void start_entry_animation();
|
||||
void trigger_exit_animation(); // Anima totes les naus
|
||||
void trigger_exit_animation_for_player(int jugador_id); // Anima només una nau (P1=1, P2=2)
|
||||
void skip_to_floating_state(); // Salta directament a FLOATING sense animació
|
||||
|
||||
// Control de visibilitat
|
||||
void set_visible(bool visible);
|
||||
bool is_animation_complete() const;
|
||||
bool is_visible() const; // Comprova si alguna nau és visible
|
||||
|
||||
private:
|
||||
SDL_Renderer* renderer_;
|
||||
|
||||
Reference in New Issue
Block a user