millorat el spawn d'enemics: perimetre de seguretat i animació amb invulnerabilitat
This commit is contained in:
@@ -228,5 +228,21 @@ constexpr float ROTACIO_ACCEL_DURACIO_MAX = 8.0f; // Max transition time
|
||||
constexpr float ROTACIO_ACCEL_MULTIPLIER_MIN = 0.5f; // Min speed multiplier
|
||||
constexpr float ROTACIO_ACCEL_MULTIPLIER_MAX = 2.5f; // Max speed multiplier
|
||||
} // namespace Animation
|
||||
|
||||
// Spawn safety and invulnerability system
|
||||
namespace Spawn {
|
||||
// Safe spawn distance from player
|
||||
constexpr float SAFETY_DISTANCE_MULTIPLIER = 3.0f; // 3x ship radius
|
||||
constexpr float SAFETY_DISTANCE = Defaults::Entities::SHIP_RADIUS * SAFETY_DISTANCE_MULTIPLIER; // 36.0f px
|
||||
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 Enemies
|
||||
} // namespace Defaults
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
// Constructor inicial amb escena LOGO i sense opcions
|
||||
ContextEscenes()
|
||||
: escena_desti_(Escena::LOGO),
|
||||
opcio_(Opcio::NONE) {}
|
||||
opcio_(Opcio::NONE) {}
|
||||
|
||||
// Canviar escena amb opció específica
|
||||
void canviar_escena(Escena nova_escena, Opcio opcio = Opcio::NONE) {
|
||||
|
||||
@@ -218,7 +218,11 @@ auto Director::run() -> int {
|
||||
|
||||
// Crear context d'escenes
|
||||
ContextEscenes context;
|
||||
#ifdef _DEBUG
|
||||
context.canviar_escena(Escena::JOC);
|
||||
#else
|
||||
context.canviar_escena(Escena::LOGO);
|
||||
#endif
|
||||
|
||||
// Bucle principal de gestió d'escenes
|
||||
while (context.escena_desti() != Escena::EIXIR) {
|
||||
|
||||
Reference in New Issue
Block a user