This commit is contained in:
2025-10-19 22:01:31 +02:00
parent 16306f2325
commit 2b4523d644
101 changed files with 2058 additions and 1564 deletions

View File

@@ -63,12 +63,12 @@ void BalloonManager::init() {
}
// Actualiza (time-based)
void BalloonManager::update(float deltaTime) {
void BalloonManager::update(float delta_time) {
for (const auto& balloon : balloons_) {
balloon->update(deltaTime);
balloon->update(delta_time);
}
updateBalloonDeployCounter(deltaTime);
explosions_->update(deltaTime);
updateBalloonDeployCounter(delta_time);
explosions_->update(delta_time);
}
// Renderiza los objetos
@@ -82,7 +82,7 @@ void BalloonManager::render() {
// Crea una formación de globos
void BalloonManager::deployRandomFormation(int stage) {
// Solo despliega una formación enemiga si el timer ha llegado a cero
if (balloon_deploy_counter_ <= 0.0f) {
if (balloon_deploy_counter_ <= 0.0F) {
// En este punto se decide entre crear una powerball o una formación enemiga
if ((rand() % 100 < 15) && (canPowerBallBeCreated())) {
createPowerBall(); // Crea una powerball
@@ -114,7 +114,7 @@ void BalloonManager::deployRandomFormation(int stage) {
.size = balloon.size,
.vel_x = balloon.vel_x,
.game_tempo = balloon_speed_,
.creation_counter = creation_time_enabled_ ? balloon.creation_counter : 0.0f};
.creation_counter = creation_time_enabled_ ? balloon.creation_counter : 0.0F};
createBalloon(config);
}
@@ -163,9 +163,9 @@ void BalloonManager::freeBalloons() {
}
// Actualiza el timer de despliegue de globos (time-based)
void BalloonManager::updateBalloonDeployCounter(float deltaTime) {
void BalloonManager::updateBalloonDeployCounter(float delta_time) {
// DeltaTime en segundos - timer decrementa hasta llegar a cero
balloon_deploy_counter_ -= deltaTime;
balloon_deploy_counter_ -= delta_time;
}
// Indica si se puede crear una powerball