ja s'ha liat la cosa per no fer pull, ostia

This commit is contained in:
2025-07-24 14:00:05 +02:00
parent 55d5957ff0
commit fa6fbeb09c
8 changed files with 298 additions and 284 deletions

View File

@@ -33,12 +33,12 @@ Balloon::Balloon(float x, float y, Type type, Size size, float vel_x, float spee
const int INDEX = static_cast<int>(size_);
gravity_ = param.balloon.settings.at(INDEX).grav;
default_vy_ = param.balloon.settings.at(INDEX).vel;
h_ = w_ = SIZE[INDEX];
power_ = POWER[INDEX];
menace_ = MENACE[INDEX];
score_ = SCORE[INDEX];
bouncing_sound_ = BOUNCING_SOUND[INDEX];
popping_sound_ = POPPING_SOUND[INDEX];
h_ = w_ = SIZE.at(INDEX);
power_ = POWER.at(INDEX);
menace_ = MENACE.at(INDEX);
score_ = SCORE.at(INDEX);
bouncing_sound_ = BOUNCING_SOUND.at(INDEX);
popping_sound_ = POPPING_SOUND.at(INDEX);
break;
}
@@ -48,20 +48,20 @@ Balloon::Balloon(float x, float y, Type type, Size size, float vel_x, float spee
gravity_ = 0.00F;
const int INDEX = static_cast<int>(size_);
h_ = w_ = SIZE[INDEX];
power_ = POWER[INDEX];
menace_ = MENACE[INDEX];
score_ = SCORE[INDEX];
bouncing_sound_ = BOUNCING_SOUND[INDEX];
popping_sound_ = POPPING_SOUND[INDEX];
h_ = w_ = SIZE.at(INDEX);
power_ = POWER.at(INDEX);
menace_ = MENACE.at(INDEX);
score_ = SCORE.at(INDEX);
bouncing_sound_ = BOUNCING_SOUND.at(INDEX);
popping_sound_ = POPPING_SOUND.at(INDEX);
break;
}
case Type::POWERBALL: {
constexpr int INDEX = 3;
h_ = w_ = SIZE[4];
bouncing_sound_ = BOUNCING_SOUND[3];
h_ = w_ = SIZE.at(4);
bouncing_sound_ = BOUNCING_SOUND.at(3);
popping_sound_ = "power_ball_explosion.wav";
power_ = score_ = menace_ = 0;
@@ -107,7 +107,7 @@ void Balloon::render() {
// Renderiza el fondo azul
{
auto sp = std::make_unique<Sprite>(sprite_->getTexture(), sprite_->getPosition());
sp->setSpriteClip(0, 0, SIZE[4], SIZE[4]);
sp->setSpriteClip(0, 0, SIZE.at(4), SIZE.at(4));
sp->render();
}
@@ -121,7 +121,7 @@ void Balloon::render() {
// Añade la máscara del borde y los reflejos
{
auto sp = std::make_unique<Sprite>(sprite_->getTexture(), sprite_->getPosition());
sp->setSpriteClip(SIZE[4] * 2, 0, SIZE[4], SIZE[4]);
sp->setSpriteClip(SIZE.at(4) * 2, 0, SIZE.at(4), SIZE.at(4));
sp->render();
}
} else {
@@ -352,7 +352,7 @@ void Balloon::applyBounceEffect() {
// Activa el efecto
void Balloon::enableBounceEffect() {
// Los globos pequeños no tienen efecto de rebote
if (size_ == Size::SIZE_0) {
if (size_ == Size::SMALL) {
return;
}
bounce_effect_.enabled = true;
@@ -371,8 +371,8 @@ void Balloon::disableBounceEffect() {
void Balloon::updateBounceEffect() {
if (bounce_effect_.enabled) {
const int INDEX = bounce_effect_.counter / bounce_effect_.speed;
bounce_effect_.horizontal_zoom = bounce_effect_.horizontal_zoom_values[INDEX];
bounce_effect_.verical_zoom = bounce_effect_.vertical_zoom_values[INDEX];
bounce_effect_.horizontal_zoom = bounce_effect_.horizontal_zoom_values.at(INDEX);
bounce_effect_.verical_zoom = bounce_effect_.vertical_zoom_values.at(INDEX);
applyBounceEffect();