Modificat el color dels nuvols de la última pantalla

debug: opció de no crear mes globos
This commit is contained in:
2025-01-05 09:22:30 +01:00
parent 198aa45d59
commit cd806363e8
8 changed files with 57 additions and 44 deletions

View File

@@ -114,7 +114,7 @@ Background::~Background()
void Background::update()
{
// Actualiza el valor de alpha_
updateAlphaColorText();
updateAlphaColorTexture();
// Actualiza las nubes
updateClouds();
@@ -293,7 +293,7 @@ void Background::setAlpha(int alpha)
}
// Actualiza el valor de alpha_
void Background::updateAlphaColorText()
void Background::updateAlphaColorTexture()
{
if (alpha_color_text_ == alpha_color_text_temp_)
{
@@ -346,22 +346,20 @@ void Background::updateClouds()
// Precalcula el vector con el recorrido del sol
void Background::createSunPath()
{
constexpr int OFFSET_X = 94; // Desplazamiento en la textura del sol hasta el sol
constexpr int OFFSET_Y = 48; // Desplazamiento en la textura del sol hasta el sol
constexpr int CENTER_X = 270;
const int center_y = base_ - 30;
constexpr int RADIUS = 130;
const int EXTRA_PIXELS = 30; // Píxeles adicionales para la línea recta
constexpr int CENTER_X = 170;
const int center_y = base_ - 80;
constexpr int RADIUS = 120;
// Generar puntos de la curva desde 90 a 180 grados
for (double theta = M_PI / 2; theta <= M_PI; theta += 0.01)
{
int x = CENTER_X + static_cast<int>(RADIUS * cos(theta));
int y = center_y - static_cast<int>(RADIUS * sin(theta)); // Nota: y está invertido en la pantalla
sun_path_.push_back({x - OFFSET_X, y - OFFSET_Y});
int y = center_y - static_cast<int>(RADIUS * sin(theta));
sun_path_.push_back({x, y});
}
// Agregar puntos en línea recta después de la curva
constexpr int EXTRA_PIXELS = 40;
SDL_Point last_point = sun_path_.back();
for (int i = 1; i <= EXTRA_PIXELS; ++i)
{
@@ -380,7 +378,7 @@ void Background::createMoonPath()
for (double theta = 0; theta <= M_PI / 2; theta += 0.01)
{
int x = CENTER_X + static_cast<int>(RADIUS * cos(theta));
int y = center_y - static_cast<int>(RADIUS * sin(theta)); // Nota: y está invertido en la pantalla
int y = center_y - static_cast<int>(RADIUS * sin(theta));
moon_path_.push_back({x, y});
}
}