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:
2026-05-19 11:44:45 +02:00
parent 5871d29d48
commit 7ee359b910
59 changed files with 998 additions and 998 deletions
+18 -18
View File
@@ -107,7 +107,7 @@ constexpr float ENEMY_RADIUS = 20.0F;
constexpr float BULLET_RADIUS = 3.0F;
} // namespace Entities
// Ship (nave del jugador)
// Ship (nave del player)
namespace Ship {
// Invulnerabilidad post-respawn
constexpr float INVULNERABILITY_DURATION = 3.0F; // Segundos de invulnerabilidad
@@ -151,11 +151,11 @@ constexpr float INIT_HUD_RECT_RATIO_END = 0.85F;
constexpr float INIT_HUD_SCORE_RATIO_INIT = 0.60F;
constexpr float INIT_HUD_SCORE_RATIO_END = 0.90F;
// SHIP1 (nave jugador 1)
// SHIP1 (nave player 1)
constexpr float INIT_HUD_SHIP1_RATIO_INIT = 0.0F;
constexpr float INIT_HUD_SHIP1_RATIO_END = 1.0F;
// SHIP2 (nave jugador 2)
// SHIP2 (nave player 2)
constexpr float INIT_HUD_SHIP2_RATIO_INIT = 0.20F;
constexpr float INIT_HUD_SHIP2_RATIO_END = 1.0F;
@@ -220,7 +220,7 @@ constexpr float TEMPS_VIDA = 2.0F; // Duració màxima (segons) - enem
constexpr float TEMPS_VIDA_NAU = 3.0F; // Ship debris lifetime (matches DEATH_DURATION)
constexpr float SHRINK_RATE = 0.5F; // Reducció de mida (factor/s)
// Herència de velocitat angular (trayectorias curvas)
// Herència de velocity angular (trayectorias curvas)
constexpr float FACTOR_HERENCIA_MIN = 0.7F; // Mínimo 70% del drotacio heredat
constexpr float FACTOR_HERENCIA_MAX = 1.0F; // Màxim 100% del drotacio heredat
constexpr float FRICCIO_ANGULAR = 0.5F; // Desacceleració angular (rad/s²)
@@ -261,10 +261,10 @@ constexpr uint8_t BACKGROUND_MAX_G = 15;
constexpr uint8_t BACKGROUND_MAX_B = 0;
} // namespace Color
// Brillantor (control de intensitat per cada tipus d'entitat)
// Brillantor (control de intensitat per cada type d'entitat)
namespace Brightness {
// Brillantor estàtica per entitats de joc (0.0-1.0)
constexpr float NAU = 1.0F; // Màxima visibilitat (jugador)
constexpr float NAU = 1.0F; // Màxima visibilitat (player)
constexpr float ENEMIC = 0.7F; // 30% més tènue (destaca menys)
constexpr float BALA = 1.0F; // Brillo a tope (màxima visibilitat)
@@ -306,7 +306,7 @@ constexpr const char* FRIENDLY_FIRE_HIT = "effects/friendly_fire.wav"; //
constexpr const char* INIT_HUD = "effects/init_hud.wav"; // Para la animación del HUD
constexpr const char* LASER = "effects/laser_shoot.wav"; // Disparo
constexpr const char* LOGO = "effects/logo.wav"; // Logo
constexpr const char* START = "effects/start.wav"; // El jugador pulsa START
constexpr const char* START = "effects/start.wav"; // El player pulsa START
constexpr const char* GOOD_JOB_COMMANDER = "voices/good_job_commander.wav"; // Voz: "Good job, commander"
} // namespace Sound
@@ -327,7 +327,7 @@ constexpr SDL_Keycode SHOOT = SDLK_LSHIFT;
} // namespace P2
} // namespace Controls
// Enemy type configuration (tipus d'enemics)
// Enemy type configuration (type d'enemics)
namespace Enemies {
// Pentagon (esquivador - zigzag evasion)
namespace Pentagon {
@@ -395,7 +395,7 @@ constexpr float INVULNERABILITY_SCALE_START = 0.0F; // Invisible
constexpr float INVULNERABILITY_SCALE_END = 1.0F; // Full size
} // namespace Spawn
// Scoring system (puntuació per tipus d'enemic)
// Scoring system (puntuació per type d'enemy)
namespace Scoring {
constexpr int PENTAGON_SCORE = 100; // Pentàgon (esquivador, 35 px/s)
constexpr int QUADRAT_SCORE = 150; // Quadrat (perseguidor, 40 px/s)
@@ -426,7 +426,7 @@ constexpr float CLOCK_RADIUS = 150.0F; // Distància des del centre
constexpr float CLOCK_8_ANGLE = 150.0F * Math::PI / 180.0F; // 8 o'clock (bottom-left)
constexpr float CLOCK_4_ANGLE = 30.0F * Math::PI / 180.0F; // 4 o'clock (bottom-right)
// 5. Radio máximo de la forma de la nave (para calcular offset automáticamente)
// 5. Radio máximo de la shape de la nave (para calcular offset automáticamente)
constexpr float SHIP_MAX_RADIUS = 30.0F; // Radi del cercle circumscrit a ship_starfield.shp
// 6. Margen de seguridad para offset de entrada
@@ -436,7 +436,7 @@ constexpr float ENTRY_OFFSET_MARGIN = 227.5F; // Para offset total de ~340px (a
// VALORS DERIVATS (calculats automàticament - NO modificar)
// ============================================================
// Centre de la pantalla (punt de referència)
// Centre de la pantalla (point de referència)
constexpr float CENTER_X = Game::WIDTH / 2.0F; // 320.0f
constexpr float CENTER_Y = Game::HEIGHT / 2.0F; // 240.0f
@@ -458,10 +458,10 @@ inline float P2_TARGET_Y() {
// Escales d'animació (relatives a SHIP_BASE_SCALE)
constexpr float ENTRY_SCALE_START = 1.5F * SHIP_BASE_SCALE; // Entrada: 50% més gran
constexpr float FLOATING_SCALE = 1.0F * SHIP_BASE_SCALE; // Flotant: escala base
constexpr float FLOATING_SCALE = 1.0F * SHIP_BASE_SCALE; // Flotant: scale base
// Offset d'entrada (ajustat automàticament a l'escala)
// Fórmula: (radi màxim de la nau * escala d'entrada) + marge
// Offset d'entrada (ajustat automàticament a l'scale)
// Fórmula: (radi màxim de la ship * scale d'entrada) + marge
constexpr float ENTRY_OFFSET = (SHIP_MAX_RADIUS * ENTRY_SCALE_START) + ENTRY_OFFSET_MARGIN;
// Vec2 de fuga (centre per a l'animació de sortida)
@@ -476,7 +476,7 @@ constexpr float VANISHING_POINT_Y = CENTER_Y; // 240.0f
constexpr float ENTRY_DURATION = 2.0F; // Entrada (segons)
constexpr float EXIT_DURATION = 1.0F; // Sortida (segons)
// Flotació (oscil·lació reduïda i diferenciada per nau)
// Flotació (oscil·lació reduïda i diferenciada per ship)
constexpr float FLOAT_AMPLITUDE_X = 4.0F; // Amplitud X (píxels)
constexpr float FLOAT_AMPLITUDE_Y = 2.5F; // Amplitud Y (píxels)
@@ -489,10 +489,10 @@ constexpr float FLOAT_PHASE_OFFSET = 1.57F; // π/2 (90°)
constexpr float P1_ENTRY_DELAY = 0.0F; // P1 entra immediatament
constexpr float P2_ENTRY_DELAY = 0.5F; // P2 entra 0.5s després
// Delay global abans d'iniciar l'animació d'entrada al estat MAIN
// Delay global abans d'iniciar l'animació d'entrada al state MAIN
constexpr float ENTRANCE_DELAY = 5.0F; // Temps d'espera abans que les naus entrin
// Multiplicadors de freqüència per a cada nau (variació sutil ±12%)
// Multiplicadors de freqüència per a cada ship (variació sutil ±12%)
constexpr float P1_FREQUENCY_MULTIPLIER = 0.88F; // 12% més lenta
constexpr float P2_FREQUENCY_MULTIPLIER = 1.12F; // 12% més ràpida
@@ -508,7 +508,7 @@ constexpr float COPYRIGHT1_POS = 0.90F; // Primera línia copyright
constexpr float LOGO_LINE_SPACING = 0.02F; // Entre "ORNI" i "ATTACK!" (10px)
constexpr float COPYRIGHT_LINE_SPACING = 0.0F; // Entre línies copyright (5px)
// Factors d'escala
// Factors d'scale
constexpr float LOGO_SCALE = 0.6F; // Escala "ORNI ATTACK!"
constexpr float PRESS_START_SCALE = 1.0F; // Escala "PRESS START TO PLAY"
constexpr float COPYRIGHT_SCALE = 0.5F; // Escala copyright