Fase 1d: rename del codi restant (effects, stage_system, locals)
Sweep final del naming a CamelCase/camelBack/lower_case:
Fitxers renombrats:
- effects/gestor_puntuacio_flotant.{hpp,cpp} -> floating_score_manager.{hpp,cpp}
- effects/puntuacio_flotant.hpp -> floating_score.hpp
Tipus (CamelCase):
- GestorPuntuacioFlotant -> FloatingScoreManager
- PuntuacioFlotant -> FloatingScore
- ConfigStage -> StageConfig
- ConfigSistemaStages -> StageSystemConfig
- NauTitol -> TitleShip
- EstatNau -> ShipState
Metodes publics (camelBack):
- obte_renderer -> getRenderer
- get_num_actius -> getActiveCount
- calcular_direccio_explosio -> computeExplosionDirection
- trobar_slot_lliure -> findFreeSlot
- explotar -> explode
- reiniciar -> reset
- es_valida -> isValid
- parsejar_fitxer -> parseFile
- carregar -> load
- crear_explosio -> createExplosion
- registrar_puntuacio -> registerScore
- construir_marcador -> buildScoreboard
- render_centered -> renderCentered
Camps struct publics (snake_case):
- actiu/actius -> active
- rotacio -> rotation, rotacio_visual -> visual_rotation
- acceleracio -> acceleration
- velocitat -> velocity
- escala/escala_inicial/objectiu/actual -> scale/initial_scale/...
- posicio/posicio_inicial/objectiu/actual -> position/initial_position/...
- fase_oscilacio -> oscillation_phase
- temps_estat -> state_time
- jugador_id -> player_id
- estat -> state
- brillantor -> brightness
- tipus -> type
Camps privats (sufix _):
- naus_ -> ships_, orni_ -> enemies_, bales_ -> bullets_
- gestor_puntuacio_ -> floating_score_manager_
- punt_mort_ -> death_position_, punt_spawn_ -> spawn_position_
- itocado_per_jugador_ -> hit_timer_per_player_
- vides_per_jugador_ -> lives_per_player_
- puntuacio_per_jugador_ -> score_per_player_
- estat_game_over_ -> game_over_state_
- continues_usados_ -> continues_used_
Constants:
- MARGE_ESQ/DRET/DALT/BAIX -> MARGIN_LEFT/RIGHT/TOP/BOTTOM
Variables locals i parametres comuns (snake_case):
- nau -> ship, enemic -> enemy, bala -> bullet
- forma -> shape, punt(s) -> point(s)
- jugador -> player, partida -> match
- temps -> time, missatge -> message
Diff: 59 fitxers, +1000/-1000 (simetric). Compila i enllaça.
Pendents per a futures fases (no bloquejants):
- Comentaris de capçalera en catala -> castella
- Variables locals/parametres minoritaris en catala
- Include guards (queden alguns #ifndef en lloc de #pragma once)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+136
-136
@@ -22,53 +22,53 @@ void ShipAnimator::init() {
|
||||
auto forma_p1 = Graphics::ShapeLoader::load("ship_perspective.shp"); // Perspectiva esquerra
|
||||
auto forma_p2 = Graphics::ShapeLoader::load("ship2_perspective.shp"); // Perspectiva dreta
|
||||
|
||||
// Configurar nau P1
|
||||
naus_[0].jugador_id = 1;
|
||||
naus_[0].forma = forma_p1;
|
||||
configurar_nau_p1(naus_[0]);
|
||||
// Configurar ship P1
|
||||
ships_[0].player_id = 1;
|
||||
ships_[0].shape = forma_p1;
|
||||
configurar_nau_p1(ships_[0]);
|
||||
|
||||
// Configurar nau P2
|
||||
naus_[1].jugador_id = 2;
|
||||
naus_[1].forma = forma_p2;
|
||||
configurar_nau_p2(naus_[1]);
|
||||
// Configurar ship P2
|
||||
ships_[1].player_id = 2;
|
||||
ships_[1].shape = forma_p2;
|
||||
configurar_nau_p2(ships_[1]);
|
||||
}
|
||||
|
||||
void ShipAnimator::update(float delta_time) {
|
||||
// Dispatcher segons estat de cada nau
|
||||
for (auto& nau : naus_) {
|
||||
if (!nau.visible) {
|
||||
// Dispatcher segons state de cada ship
|
||||
for (auto& ship : ships_) {
|
||||
if (!ship.visible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (nau.estat) {
|
||||
case EstatNau::ENTERING:
|
||||
actualitzar_entering(nau, delta_time);
|
||||
switch (ship.state) {
|
||||
case ShipState::ENTERING:
|
||||
actualitzar_entering(ship, delta_time);
|
||||
break;
|
||||
case EstatNau::FLOATING:
|
||||
actualitzar_floating(nau, delta_time);
|
||||
case ShipState::FLOATING:
|
||||
actualitzar_floating(ship, delta_time);
|
||||
break;
|
||||
case EstatNau::EXITING:
|
||||
actualitzar_exiting(nau, delta_time);
|
||||
case ShipState::EXITING:
|
||||
actualitzar_exiting(ship, delta_time);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ShipAnimator::draw() const {
|
||||
for (const auto& nau : naus_) {
|
||||
if (!nau.visible) {
|
||||
for (const auto& ship : ships_) {
|
||||
if (!ship.visible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Renderitzar nau (perspectiva ja incorporada a la forma)
|
||||
// Renderitzar ship (perspectiva ja incorporada a la shape)
|
||||
Rendering::render_shape(
|
||||
renderer_,
|
||||
nau.forma,
|
||||
nau.posicio_actual,
|
||||
ship.shape,
|
||||
ship.current_position,
|
||||
0.0F, // angle (rotació 2D no utilitzada)
|
||||
nau.escala_actual,
|
||||
ship.current_scale,
|
||||
1.0F, // progress (sempre visible)
|
||||
1.0F // brightness (brillantor màxima)
|
||||
1.0F // brightness (brightness màxima)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -76,46 +76,46 @@ void ShipAnimator::draw() const {
|
||||
void ShipAnimator::start_entry_animation() {
|
||||
using namespace Defaults::Title::Ships;
|
||||
|
||||
// Configurar nau P1 per a l'animació d'entrada
|
||||
naus_[0].estat = EstatNau::ENTERING;
|
||||
naus_[0].temps_estat = 0.0F;
|
||||
naus_[0].posicio_inicial = calcular_posicio_fora_pantalla(CLOCK_8_ANGLE);
|
||||
naus_[0].posicio_actual = naus_[0].posicio_inicial;
|
||||
naus_[0].escala_actual = naus_[0].escala_inicial;
|
||||
// Configurar ship P1 per a l'animació d'entrada
|
||||
ships_[0].state = ShipState::ENTERING;
|
||||
ships_[0].state_time = 0.0F;
|
||||
ships_[0].initial_position = calcular_posicio_fora_pantalla(CLOCK_8_ANGLE);
|
||||
ships_[0].current_position = ships_[0].initial_position;
|
||||
ships_[0].current_scale = ships_[0].initial_scale;
|
||||
|
||||
// Configurar nau P2 per a l'animació d'entrada
|
||||
naus_[1].estat = EstatNau::ENTERING;
|
||||
naus_[1].temps_estat = 0.0F;
|
||||
naus_[1].posicio_inicial = calcular_posicio_fora_pantalla(CLOCK_4_ANGLE);
|
||||
naus_[1].posicio_actual = naus_[1].posicio_inicial;
|
||||
naus_[1].escala_actual = naus_[1].escala_inicial;
|
||||
// Configurar ship P2 per a l'animació d'entrada
|
||||
ships_[1].state = ShipState::ENTERING;
|
||||
ships_[1].state_time = 0.0F;
|
||||
ships_[1].initial_position = calcular_posicio_fora_pantalla(CLOCK_4_ANGLE);
|
||||
ships_[1].current_position = ships_[1].initial_position;
|
||||
ships_[1].current_scale = ships_[1].initial_scale;
|
||||
}
|
||||
|
||||
void ShipAnimator::trigger_exit_animation() {
|
||||
// Configurar ambdues naus per a l'animació de sortida
|
||||
for (auto& nau : naus_) {
|
||||
// Canviar estat a EXITING
|
||||
nau.estat = EstatNau::EXITING;
|
||||
nau.temps_estat = 0.0F;
|
||||
for (auto& ship : ships_) {
|
||||
// Canviar state a EXITING
|
||||
ship.state = ShipState::EXITING;
|
||||
ship.state_time = 0.0F;
|
||||
|
||||
// Preservar posició actual (pot estar a mig camí si START es prem durant ENTERING)
|
||||
nau.posicio_inicial = nau.posicio_actual;
|
||||
ship.initial_position = ship.current_position;
|
||||
|
||||
// La escala objectiu es preserva per a calcular la interpolació
|
||||
// (escala_actual pot ser diferent si està en ENTERING)
|
||||
// La scale objectiu es preserva per a calcular la interpolació
|
||||
// (current_scale pot ser diferent si està en ENTERING)
|
||||
}
|
||||
}
|
||||
|
||||
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 ambdues naus directament en state FLOATING
|
||||
for (auto& ship : ships_) {
|
||||
ship.state = ShipState::FLOATING;
|
||||
ship.state_time = 0.0F;
|
||||
ship.oscillation_phase = 0.0F;
|
||||
|
||||
// Posar en posició objectiu (sense animació)
|
||||
nau.posicio_actual = nau.posicio_objectiu;
|
||||
nau.escala_actual = nau.escala_objectiu;
|
||||
ship.current_position = ship.target_position;
|
||||
ship.current_scale = ship.target_scale;
|
||||
|
||||
// NO establir visibilitat aquí - ja ho fa el caller
|
||||
// (evita fer visibles ambdues naus quan només una ha premut START)
|
||||
@@ -123,201 +123,201 @@ void ShipAnimator::skip_to_floating_state() {
|
||||
}
|
||||
|
||||
bool ShipAnimator::is_visible() const {
|
||||
// Retorna true si almenys una nau és visible
|
||||
for (const auto& nau : naus_) {
|
||||
if (nau.visible) {
|
||||
// Retorna true si almenys una ship és visible
|
||||
for (const auto& ship : ships_) {
|
||||
if (ship.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_) {
|
||||
if (nau.jugador_id == jugador_id) {
|
||||
// Canviar estat a EXITING només per aquesta nau
|
||||
nau.estat = EstatNau::EXITING;
|
||||
nau.temps_estat = 0.0F;
|
||||
void ShipAnimator::trigger_exit_animation_for_player(int player_id) {
|
||||
// Trobar la ship del player especificat
|
||||
for (auto& ship : ships_) {
|
||||
if (ship.player_id == player_id) {
|
||||
// Canviar state a EXITING només per aquesta ship
|
||||
ship.state = ShipState::EXITING;
|
||||
ship.state_time = 0.0F;
|
||||
|
||||
// Preservar posició actual (pot estar a mig camí si START es prem durant ENTERING)
|
||||
nau.posicio_inicial = nau.posicio_actual;
|
||||
ship.initial_position = ship.current_position;
|
||||
|
||||
// La escala objectiu es preserva per a calcular la interpolació
|
||||
// (escala_actual pot ser diferent si està en ENTERING)
|
||||
break; // Només una nau per jugador
|
||||
// La scale objectiu es preserva per a calcular la interpolació
|
||||
// (current_scale pot ser diferent si està en ENTERING)
|
||||
break; // Només una ship per player
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ShipAnimator::set_visible(bool visible) {
|
||||
for (auto& nau : naus_) {
|
||||
nau.visible = visible;
|
||||
for (auto& ship : ships_) {
|
||||
ship.visible = visible;
|
||||
}
|
||||
}
|
||||
|
||||
bool ShipAnimator::is_animation_complete() const {
|
||||
// Comprovar si totes les naus són invisibles (han completat l'animació de sortida)
|
||||
for (const auto& nau : naus_) {
|
||||
if (nau.visible) {
|
||||
return false; // Encara hi ha alguna nau visible
|
||||
for (const auto& ship : ships_) {
|
||||
if (ship.visible) {
|
||||
return false; // Encara hi ha alguna ship visible
|
||||
}
|
||||
}
|
||||
return true; // Totes les naus són invisibles
|
||||
}
|
||||
|
||||
// Mètodes d'animació (stubs)
|
||||
void ShipAnimator::actualitzar_entering(NauTitol& nau, float delta_time) {
|
||||
void ShipAnimator::actualitzar_entering(TitleShip& ship, float delta_time) {
|
||||
using namespace Defaults::Title::Ships;
|
||||
|
||||
nau.temps_estat += delta_time;
|
||||
ship.state_time += delta_time;
|
||||
|
||||
// Esperar al delay abans de començar l'animació
|
||||
if (nau.temps_estat < nau.entry_delay) {
|
||||
// Encara en delay: la nau es queda fora de pantalla (posició inicial)
|
||||
nau.posicio_actual = nau.posicio_inicial;
|
||||
nau.escala_actual = nau.escala_inicial;
|
||||
if (ship.state_time < ship.entry_delay) {
|
||||
// Encara en delay: la ship es queda fora de pantalla (posició inicial)
|
||||
ship.current_position = ship.initial_position;
|
||||
ship.current_scale = ship.initial_scale;
|
||||
return;
|
||||
}
|
||||
|
||||
// Càlcul del progrés (restant el delay)
|
||||
float elapsed = nau.temps_estat - nau.entry_delay;
|
||||
float elapsed = ship.state_time - ship.entry_delay;
|
||||
float progress = std::min(1.0F, elapsed / ENTRY_DURATION);
|
||||
|
||||
// Aplicar easing (ease_out_quad per arribada suau)
|
||||
float eased_progress = Easing::ease_out_quad(progress);
|
||||
|
||||
// Lerp posició (inicial → objectiu)
|
||||
nau.posicio_actual.x = Easing::lerp(nau.posicio_inicial.x, nau.posicio_objectiu.x, eased_progress);
|
||||
nau.posicio_actual.y = Easing::lerp(nau.posicio_inicial.y, nau.posicio_objectiu.y, eased_progress);
|
||||
ship.current_position.x = Easing::lerp(ship.initial_position.x, ship.target_position.x, eased_progress);
|
||||
ship.current_position.y = Easing::lerp(ship.initial_position.y, ship.target_position.y, eased_progress);
|
||||
|
||||
// Lerp escala (gran → normal)
|
||||
nau.escala_actual = Easing::lerp(nau.escala_inicial, nau.escala_objectiu, eased_progress);
|
||||
// Lerp scale (gran → normal)
|
||||
ship.current_scale = Easing::lerp(ship.initial_scale, ship.target_scale, eased_progress);
|
||||
|
||||
// Transicionar a FLOATING quan completi
|
||||
if (elapsed >= ENTRY_DURATION) {
|
||||
nau.estat = EstatNau::FLOATING;
|
||||
nau.temps_estat = 0.0F;
|
||||
nau.fase_oscilacio = 0.0F; // Reiniciar fase d'oscil·lació
|
||||
ship.state = ShipState::FLOATING;
|
||||
ship.state_time = 0.0F;
|
||||
ship.oscillation_phase = 0.0F; // Reiniciar fase d'oscil·lació
|
||||
}
|
||||
}
|
||||
|
||||
void ShipAnimator::actualitzar_floating(NauTitol& nau, float delta_time) {
|
||||
void ShipAnimator::actualitzar_floating(TitleShip& ship, float delta_time) {
|
||||
using namespace Defaults::Title::Ships;
|
||||
|
||||
// Actualitzar temps i fase d'oscil·lació
|
||||
nau.temps_estat += delta_time;
|
||||
nau.fase_oscilacio += delta_time;
|
||||
// Actualitzar time i fase d'oscil·lació
|
||||
ship.state_time += delta_time;
|
||||
ship.oscillation_phase += delta_time;
|
||||
|
||||
// Oscil·lació sinusoïdal X/Y (paràmetres específics per nau)
|
||||
float offset_x = nau.amplitude_x * std::sin(2.0F * Defaults::Math::PI * nau.frequency_x * nau.fase_oscilacio);
|
||||
float offset_y = nau.amplitude_y * std::sin((2.0F * Defaults::Math::PI * nau.frequency_y * nau.fase_oscilacio) + FLOAT_PHASE_OFFSET);
|
||||
// Oscil·lació sinusoïdal X/Y (paràmetres específics per ship)
|
||||
float offset_x = ship.amplitude_x * std::sin(2.0F * Defaults::Math::PI * ship.frequency_x * ship.oscillation_phase);
|
||||
float offset_y = ship.amplitude_y * std::sin((2.0F * Defaults::Math::PI * ship.frequency_y * ship.oscillation_phase) + FLOAT_PHASE_OFFSET);
|
||||
|
||||
// Aplicar oscil·lació a la posició objectiu
|
||||
nau.posicio_actual.x = nau.posicio_objectiu.x + offset_x;
|
||||
nau.posicio_actual.y = nau.posicio_objectiu.y + offset_y;
|
||||
ship.current_position.x = ship.target_position.x + offset_x;
|
||||
ship.current_position.y = ship.target_position.y + offset_y;
|
||||
|
||||
// Escala constant (sense "breathing" per ara)
|
||||
nau.escala_actual = nau.escala_objectiu;
|
||||
ship.current_scale = ship.target_scale;
|
||||
}
|
||||
|
||||
void ShipAnimator::actualitzar_exiting(NauTitol& nau, float delta_time) {
|
||||
void ShipAnimator::actualitzar_exiting(TitleShip& ship, float delta_time) {
|
||||
using namespace Defaults::Title::Ships;
|
||||
|
||||
nau.temps_estat += delta_time;
|
||||
ship.state_time += delta_time;
|
||||
|
||||
// Calcular progrés (0.0 → 1.0)
|
||||
float progress = std::min(1.0F, nau.temps_estat / EXIT_DURATION);
|
||||
float progress = std::min(1.0F, ship.state_time / EXIT_DURATION);
|
||||
|
||||
// Aplicar easing (ease_in_quad per acceleració cap al punt de fuga)
|
||||
// Aplicar easing (ease_in_quad per acceleració cap al point de fuga)
|
||||
float eased_progress = Easing::ease_in_quad(progress);
|
||||
|
||||
// Vec2 de fuga (centre del starfield)
|
||||
constexpr Vec2 punt_fuga{.x = VANISHING_POINT_X, .y = VANISHING_POINT_Y};
|
||||
|
||||
// Lerp posició cap al punt de fuga (preservar posició inicial actual)
|
||||
// Nota: posicio_inicial conté la posició on estava quan es va activar EXITING
|
||||
nau.posicio_actual.x = Easing::lerp(nau.posicio_inicial.x, punt_fuga.x, eased_progress);
|
||||
nau.posicio_actual.y = Easing::lerp(nau.posicio_inicial.y, punt_fuga.y, eased_progress);
|
||||
// Lerp posició cap al point de fuga (preservar posició inicial actual)
|
||||
// Nota: initial_position conté la posició on estava quan es va activar EXITING
|
||||
ship.current_position.x = Easing::lerp(ship.initial_position.x, punt_fuga.x, eased_progress);
|
||||
ship.current_position.y = Easing::lerp(ship.initial_position.y, punt_fuga.y, eased_progress);
|
||||
|
||||
// Escala redueix a 0 (simula Z → infinit)
|
||||
nau.escala_actual = nau.escala_objectiu * (1.0F - eased_progress);
|
||||
ship.current_scale = ship.target_scale * (1.0F - eased_progress);
|
||||
|
||||
// Marcar invisible quan l'animació completi
|
||||
if (progress >= 1.0F) {
|
||||
nau.visible = false;
|
||||
ship.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Configuració
|
||||
void ShipAnimator::configurar_nau_p1(NauTitol& nau) {
|
||||
void ShipAnimator::configurar_nau_p1(TitleShip& ship) {
|
||||
using namespace Defaults::Title::Ships;
|
||||
|
||||
// Estat inicial: FLOATING (per test estàtic)
|
||||
nau.estat = EstatNau::FLOATING;
|
||||
nau.temps_estat = 0.0F;
|
||||
ship.state = ShipState::FLOATING;
|
||||
ship.state_time = 0.0F;
|
||||
|
||||
// Posicions (clock 8, bottom-left)
|
||||
nau.posicio_objectiu = {.x = P1_TARGET_X(), .y = P1_TARGET_Y()};
|
||||
ship.target_position = {.x = P1_TARGET_X(), .y = P1_TARGET_Y()};
|
||||
|
||||
// Calcular posició inicial (fora de pantalla)
|
||||
nau.posicio_inicial = calcular_posicio_fora_pantalla(CLOCK_8_ANGLE);
|
||||
nau.posicio_actual = nau.posicio_inicial; // Començar fora de pantalla
|
||||
ship.initial_position = calcular_posicio_fora_pantalla(CLOCK_8_ANGLE);
|
||||
ship.current_position = ship.initial_position; // Començar fora de pantalla
|
||||
|
||||
// Escales
|
||||
nau.escala_objectiu = FLOATING_SCALE;
|
||||
nau.escala_actual = FLOATING_SCALE;
|
||||
nau.escala_inicial = ENTRY_SCALE_START;
|
||||
ship.target_scale = FLOATING_SCALE;
|
||||
ship.current_scale = FLOATING_SCALE;
|
||||
ship.initial_scale = ENTRY_SCALE_START;
|
||||
|
||||
// Flotació
|
||||
nau.fase_oscilacio = 0.0F;
|
||||
ship.oscillation_phase = 0.0F;
|
||||
|
||||
// Paràmetres d'entrada
|
||||
nau.entry_delay = P1_ENTRY_DELAY;
|
||||
ship.entry_delay = P1_ENTRY_DELAY;
|
||||
|
||||
// Paràmetres d'oscil·lació específics P1
|
||||
nau.amplitude_x = FLOAT_AMPLITUDE_X;
|
||||
nau.amplitude_y = FLOAT_AMPLITUDE_Y;
|
||||
nau.frequency_x = FLOAT_FREQUENCY_X_BASE * P1_FREQUENCY_MULTIPLIER;
|
||||
nau.frequency_y = FLOAT_FREQUENCY_Y_BASE * P1_FREQUENCY_MULTIPLIER;
|
||||
ship.amplitude_x = FLOAT_AMPLITUDE_X;
|
||||
ship.amplitude_y = FLOAT_AMPLITUDE_Y;
|
||||
ship.frequency_x = FLOAT_FREQUENCY_X_BASE * P1_FREQUENCY_MULTIPLIER;
|
||||
ship.frequency_y = FLOAT_FREQUENCY_Y_BASE * P1_FREQUENCY_MULTIPLIER;
|
||||
|
||||
// Visibilitat
|
||||
nau.visible = true;
|
||||
ship.visible = true;
|
||||
}
|
||||
|
||||
void ShipAnimator::configurar_nau_p2(NauTitol& nau) {
|
||||
void ShipAnimator::configurar_nau_p2(TitleShip& ship) {
|
||||
using namespace Defaults::Title::Ships;
|
||||
|
||||
// Estat inicial: FLOATING (per test estàtic)
|
||||
nau.estat = EstatNau::FLOATING;
|
||||
nau.temps_estat = 0.0F;
|
||||
ship.state = ShipState::FLOATING;
|
||||
ship.state_time = 0.0F;
|
||||
|
||||
// Posicions (clock 4, bottom-right)
|
||||
nau.posicio_objectiu = {.x = P2_TARGET_X(), .y = P2_TARGET_Y()};
|
||||
ship.target_position = {.x = P2_TARGET_X(), .y = P2_TARGET_Y()};
|
||||
|
||||
// Calcular posició inicial (fora de pantalla)
|
||||
nau.posicio_inicial = calcular_posicio_fora_pantalla(CLOCK_4_ANGLE);
|
||||
nau.posicio_actual = nau.posicio_inicial; // Començar fora de pantalla
|
||||
ship.initial_position = calcular_posicio_fora_pantalla(CLOCK_4_ANGLE);
|
||||
ship.current_position = ship.initial_position; // Començar fora de pantalla
|
||||
|
||||
// Escales
|
||||
nau.escala_objectiu = FLOATING_SCALE;
|
||||
nau.escala_actual = FLOATING_SCALE;
|
||||
nau.escala_inicial = ENTRY_SCALE_START;
|
||||
ship.target_scale = FLOATING_SCALE;
|
||||
ship.current_scale = FLOATING_SCALE;
|
||||
ship.initial_scale = ENTRY_SCALE_START;
|
||||
|
||||
// Flotació
|
||||
nau.fase_oscilacio = 0.0F;
|
||||
ship.oscillation_phase = 0.0F;
|
||||
|
||||
// Paràmetres d'entrada
|
||||
nau.entry_delay = P2_ENTRY_DELAY;
|
||||
ship.entry_delay = P2_ENTRY_DELAY;
|
||||
|
||||
// Paràmetres d'oscil·lació específics P2
|
||||
nau.amplitude_x = FLOAT_AMPLITUDE_X;
|
||||
nau.amplitude_y = FLOAT_AMPLITUDE_Y;
|
||||
nau.frequency_x = FLOAT_FREQUENCY_X_BASE * P2_FREQUENCY_MULTIPLIER;
|
||||
nau.frequency_y = FLOAT_FREQUENCY_Y_BASE * P2_FREQUENCY_MULTIPLIER;
|
||||
ship.amplitude_x = FLOAT_AMPLITUDE_X;
|
||||
ship.amplitude_y = FLOAT_AMPLITUDE_Y;
|
||||
ship.frequency_x = FLOAT_FREQUENCY_X_BASE * P2_FREQUENCY_MULTIPLIER;
|
||||
ship.frequency_y = FLOAT_FREQUENCY_Y_BASE * P2_FREQUENCY_MULTIPLIER;
|
||||
|
||||
// Visibilitat
|
||||
nau.visible = true;
|
||||
ship.visible = true;
|
||||
}
|
||||
|
||||
Vec2 ShipAnimator::calcular_posicio_fora_pantalla(float angle_rellotge) const {
|
||||
|
||||
Reference in New Issue
Block a user