jugant amb clang-tidy

This commit is contained in:
2025-07-19 22:38:01 +02:00
parent 1d3fd79a9e
commit a7ef29b750
28 changed files with 735 additions and 734 deletions

View File

@@ -74,20 +74,20 @@ Background::Background()
// Inicializa objetos
{
constexpr float top_clouds_speed = 0.1f;
constexpr float bottom_clouds_speed = 0.05f;
constexpr float TOP_CLOUDS_SPEED = 0.1f;
constexpr float BOTTOM_CLOUDS_SPEED = 0.05f;
top_clouds_sprite_a_->setSpriteClip(0, 0, top_clouds_texture_->getWidth(), top_clouds_texture_->getHeight());
top_clouds_sprite_a_->setVelX(-top_clouds_speed);
top_clouds_sprite_a_->setVelX(-TOP_CLOUDS_SPEED);
top_clouds_sprite_b_->setSpriteClip(0, 0, top_clouds_texture_->getWidth(), top_clouds_texture_->getHeight());
top_clouds_sprite_b_->setVelX(-top_clouds_speed);
top_clouds_sprite_b_->setVelX(-TOP_CLOUDS_SPEED);
bottom_clouds_sprite_a_->setSpriteClip(0, 0, bottom_clouds_texture_->getWidth(), bottom_clouds_texture_->getHeight());
bottom_clouds_sprite_a_->setVelX(-bottom_clouds_speed);
bottom_clouds_sprite_a_->setVelX(-BOTTOM_CLOUDS_SPEED);
bottom_clouds_sprite_b_->setSpriteClip(0, 0, bottom_clouds_texture_->getWidth(), bottom_clouds_texture_->getHeight());
bottom_clouds_sprite_b_->setVelX(-bottom_clouds_speed);
bottom_clouds_sprite_b_->setVelX(-BOTTOM_CLOUDS_SPEED);
buildings_sprite_->setY(base_ - buildings_sprite_->getHeight());
grass_sprite_->setY(base_ - grass_sprite_->getHeight());
@@ -317,13 +317,13 @@ void Background::updateClouds() {
// Precalcula el vector con el recorrido del sol
void Background::createSunPath() {
constexpr float CENTER_X = 170;
const float center_y = base_ - 80;
const float CENTER_Y = base_ - 80;
constexpr float RADIUS = 120;
// Generar puntos de la curva desde 90 a 180 grados
for (double theta = M_PI / 2; theta <= M_PI; theta += 0.01) {
float x = CENTER_X + (RADIUS * cos(theta));
float y = center_y - (RADIUS * sin(theta));
float y = CENTER_Y - (RADIUS * sin(theta));
sun_path_.push_back({x, y});
}
@@ -338,13 +338,13 @@ void Background::createSunPath() {
// Precalcula el vector con el recorrido de la luna
void Background::createMoonPath() {
constexpr float CENTER_X = 100;
const float center_y = base_ - 50;
const float CENTER_Y = base_ - 50;
constexpr float RADIUS = 140;
// Generar puntos de la curva desde 0 a 90 grados
for (double theta = 0; theta <= M_PI / 2; theta += 0.01) {
float x = CENTER_X + (RADIUS * cos(theta));
float y = center_y - (RADIUS * sin(theta));
float y = CENTER_Y - (RADIUS * sin(theta));
moon_path_.push_back({x, y});
}
}