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

@@ -2,11 +2,12 @@
#include <SDL3/SDL.h> // Para SDL_SetRenderTarget, SDL_CreateTexture, SDL_DestroyTexture, SDL_FRect, SDL_GetRenderTarget, SDL_RenderTexture, SDL_PixelFormat, SDL_TextureAccess
#include <algorithm>
#include <cmath> // Para sin, pow
#include <cstdlib> // Para rand
#include <memory> // Para allocator, unique_ptr, make_unique
#include <numbers> // Para pi
#include <algorithm> // Para max
#include <cmath> // Para cos, pow, sin
#include <cstdlib> // Para rand
#include <memory> // Para unique_ptr, make_unique
#include <numbers> // Para pi
#include <string> // Para basic_string
#include "resource.hpp" // Para Resource
#include "screen.hpp" // Para Screen
@@ -92,10 +93,10 @@ void TiledBG::update(float delta_time) {
}
case TiledBGMode::CIRCLE: {
// El tileado de fondo se desplaza en circulo
const float angle_rad = (desp_ * std::numbers::pi / 180.0F);
const float ANGLE_RAD = (desp_ * std::numbers::pi / 180.0F);
window_.x = 128 + static_cast<int>(std::cos(angle_rad) * 128);
window_.y = 128 + static_cast<int>(std::sin(-angle_rad) * 96);
window_.x = 128 + static_cast<int>(std::cos(ANGLE_RAD) * 128);
window_.y = 128 + static_cast<int>(std::sin(-ANGLE_RAD) * 96);
break;
}
default:
@@ -129,7 +130,7 @@ void TiledBG::updateStop(float delta_time) {
// Cambia la velocidad gradualmente en X segundos
void TiledBG::changeSpeedTo(float target_speed, float duration_s) {
if (duration_s <= 0.0f) {
if (duration_s <= 0.0F) {
// Si la duración es 0 o negativa, cambia inmediatamente
speed_ = target_speed;
changing_speed_ = false;
@@ -141,7 +142,7 @@ void TiledBG::changeSpeedTo(float target_speed, float duration_s) {
initial_speed_ = speed_;
target_speed_ = target_speed;
change_duration_s_ = duration_s;
change_timer_s_ = 0.0f;
change_timer_s_ = 0.0F;
}
// Actualiza el cambio gradual de velocidad (time-based)