65 lines
3.4 KiB
C++
65 lines
3.4 KiB
C++
// enemies.hpp - Configuració per tipus d'enemic (Pentagon/Square/Molinillo), spawn i scoring
|
|
// © 2026 JailDesigner
|
|
|
|
#pragma once
|
|
|
|
namespace Defaults::Enemies {
|
|
|
|
// Cuerpo físico común (valores por defecto del constructor)
|
|
namespace Body {
|
|
constexpr float DEFAULT_MASS = 5.0F; // Más liviano que la nave (10.0)
|
|
constexpr float RESTITUTION = 1.0F; // Rebote elástico perfecto contra paredes
|
|
constexpr float LINEAR_DAMPING = 0.0F; // Sin fricción: mantienen velocidad
|
|
constexpr float ANGULAR_DAMPING = 0.0F;
|
|
} // namespace Body
|
|
|
|
// NOTA: els paràmetres per tipus (Pentagon/Square/Pinwheel) i el Scoring
|
|
// viuen ara a data/entities/{pentagon,square,pinwheel}/*.yaml i s'accedeixen
|
|
// via EnemyRegistry::get(EnemyType). Aquí només queden els paràmetres
|
|
// compartits entre tots els tipus (animació, wounded, spawn).
|
|
|
|
// Animation parameters (shared)
|
|
namespace Animation {
|
|
// Palpitation
|
|
constexpr float PULSE_TRIGGER_PROB = 0.01F; // 1% chance per second
|
|
constexpr float PULSE_DURATION_MIN = 1.0F; // Min duration (seconds)
|
|
constexpr float PULSE_DURATION_MAX = 3.0F; // Max duration (seconds)
|
|
constexpr float PULSE_AMPLITUD_MIN = 0.08F; // Min scale variation
|
|
constexpr float PULSE_AMPLITUD_MAX = 0.20F; // Max scale variation
|
|
constexpr float PULSE_FREQ_MIN = 1.5F; // Min frequency (Hz)
|
|
constexpr float PULSE_FREQ_MAX = 3.0F; // Max frequency (Hz)
|
|
|
|
// Rotation acceleration
|
|
constexpr float ROTATION_ACCEL_TRIGGER_PROB = 0.02F; // 2% chance per second [4x more frequent]
|
|
constexpr float ROTATION_ACCEL_DURATION_MIN = 3.0F; // Min transition time
|
|
constexpr float ROTATION_ACCEL_DURATION_MAX = 8.0F; // Max transition time
|
|
constexpr float ROTATION_ACCEL_MULTIPLIER_MIN = 0.3F; // Min speed multiplier [more dramatic]
|
|
constexpr float ROTATION_ACCEL_MULTIPLIER_MAX = 4.0F; // Max speed multiplier [more dramatic]
|
|
} // namespace Animation
|
|
|
|
// Wounded state (entre primer impacto y explosión)
|
|
namespace Wounded {
|
|
constexpr float DURATION = 1.0F; // Segundos en estado herido antes de explotar
|
|
constexpr float BLINK_HZ = 10.0F; // Frecuencia de parpadeo color tipo ↔ dorado
|
|
} // namespace Wounded
|
|
|
|
// Spawn safety and invulnerability system
|
|
namespace Spawn {
|
|
// Safe spawn distance from player. Antic: SHIP_RADIUS(12) * 3 = 36 px.
|
|
// SHIP_RADIUS ha migrat al YAML del player; aquesta constant es
|
|
// mantindrà fixa fins al PR de migració dels enemics a YAML, on
|
|
// passarà a derivar-se en runtime del player_config.
|
|
constexpr float SAFETY_DISTANCE_MULTIPLIER = 3.0F;
|
|
constexpr float SAFETY_DISTANCE = 36.0F;
|
|
constexpr int MAX_SPAWN_ATTEMPTS = 50; // Max attempts to find safe position
|
|
|
|
// Invulnerability system
|
|
constexpr float INVULNERABILITY_DURATION = 3.0F; // Seconds
|
|
constexpr float INVULNERABILITY_BRIGHTNESS_START = 0.3F; // Dim
|
|
constexpr float INVULNERABILITY_BRIGHTNESS_END = 0.7F; // Normal (same as Defaults::Brightness::ENEMIC)
|
|
constexpr float INVULNERABILITY_SCALE_START = 0.0F; // Invisible
|
|
constexpr float INVULNERABILITY_SCALE_END = 1.0F; // Full size
|
|
} // namespace Spawn
|
|
|
|
} // namespace Defaults::Enemies
|