Modificada la cadencia de foc sense autofire i arreglades un poc les animacions de cool_down i cooling

This commit is contained in:
2025-01-04 10:47:26 +01:00
parent 5e817ef1d0
commit bccf4c30de
5 changed files with 67 additions and 54 deletions

View File

@@ -69,8 +69,8 @@ private:
int default_pos_y_; // Posición inicial para el jugador
float vel_x_ = 0.0f; // Cantidad de pixeles a desplazarse en el eje X
int vel_y_ = 0.0f; // Cantidad de pixeles a desplazarse en el eje Y
int cooldown_ = 0; // Contador durante el cual no puede disparar
int cooling_status_counter_ = 0; // Contador para la animación del estado cooling
int cool_down_ = 0; // Contador durante el cual no puede disparar
int cooling_state_counter_ = 0; // Contador para la animación del estado cooling
int score_ = 0; // Puntos del jugador
float score_multiplier_ = 1.0f; // Multiplicador de puntos
PlayerState walking_state_ = PlayerState::WALKING_STOP; // Estado del jugador al moverse
@@ -207,10 +207,10 @@ public:
bool isWaiting() const { return playing_state_ == PlayerState::WAITING; }
// Getters
bool canFire() const { return cooldown_ > 0 ? false : true; }
bool canFire() const { return cool_down_ > 0 ? false : true; }
bool hasExtraHit() const { return extra_hit_; }
bool isCooling() { return firing_state_ == PlayerState::COOLING_LEFT || firing_state_ == PlayerState::COOLING_UP || firing_state_ == PlayerState::COOLING_RIGHT; }
bool IsEligibleForHighScore() { return score_ > options.game.hi_score_table.back().score; }
bool isCooling() const { return firing_state_ == PlayerState::COOLING_LEFT || firing_state_ == PlayerState::COOLING_UP || firing_state_ == PlayerState::COOLING_RIGHT; }
bool IsEligibleForHighScore() const { return score_ > options.game.hi_score_table.back().score; }
bool isInvulnerable() const { return invulnerable_; }
bool isPowerUp() const { return power_up_; }
Circle &getCollider() { return collider_; }
@@ -233,7 +233,7 @@ public:
// Setters
void setController(int index) { controller_index_ = index; }
void setFireCooldown(int time) { cooldown_ = time; }
void setFireCooldown(int time) { cool_down_ = time; }
void setFiringState(PlayerState state) { firing_state_ = state; }
void setInvulnerableCounter(int value) { invulnerable_counter_ = value; }
void setName(const std::string &name) { name_ = name; }