fix: en windows no es calculaven be les colisions

This commit is contained in:
2025-03-20 18:45:49 +01:00
parent 0667e2105b
commit b8cde79107
2 changed files with 3 additions and 3 deletions

View File

@@ -40,7 +40,7 @@ Game::Game(GameMode mode)
#endif
{
#ifdef DEBUG
Debug::get()->setEnabled(true);
Debug::get()->setEnabled(false);
#endif
// Crea objetos e inicializa variables

View File

@@ -267,7 +267,7 @@ void Player::move()
proj.x = static_cast<int>(x_ + vx_);
proj.y = static_cast<int>(y_);
proj.h = HEIGHT_;
proj.w = ceil(abs(vx_)); // Para evitar que tenga un ancho de 0 pixels
proj.w = static_cast<int>(std::ceil(std::fabs(vx_))); // Para evitar que tenga un ancho de 0 pixels
#ifdef DEBUG
debug_rect_x_ = proj;
@@ -376,7 +376,7 @@ void Player::move()
SDL_Rect proj;
proj.x = static_cast<int>(x_);
proj.y = static_cast<int>(y_ + vy_);
proj.h = ceil(abs(vy_)); // Para evitar que tenga una altura de 0 pixels
proj.h = static_cast<int>(std::ceil(std::fabs(vy_))); // Para evitar que tenga una altura de 0 pixels
proj.w = WIDTH_;
#ifdef DEBUG