From f3bad9f4ed80e6d0f9cbc623165f6196834ec7c8 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Mon, 30 Mar 2026 20:19:07 +0200 Subject: [PATCH] afegida guarda per a que en debug el jugador no caiga infinitament si ix de la pantalla --- source/game/entities/player.cpp | 4 ++++ source/game/ui/console.hpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/game/entities/player.cpp b/source/game/entities/player.cpp index f901e6c89..fe0722013 100644 --- a/source/game/entities/player.cpp +++ b/source/game/entities/player.cpp @@ -880,6 +880,10 @@ auto Player::handleLandingFromAir(float displacement, const SDL_FRect& projectio // No hay colisión y_ += displacement; +#ifdef _DEBUG + // Guarda por si en debug el jugador se sale de la pantalla, para que no esté cayendo infinitamente + if (y_ > PlayArea::BOTTOM + HEIGHT) { y_ = PlayArea::TOP + 2; } +#endif return false; } diff --git a/source/game/ui/console.hpp b/source/game/ui/console.hpp index 194b6edfb..259e9b6bf 100644 --- a/source/game/ui/console.hpp +++ b/source/game/ui/console.hpp @@ -45,7 +45,7 @@ class Console { static constexpr Uint8 BG_COLOR = 0; // PaletteColor::BLACK static constexpr Uint8 BORDER_COLOR = 9; // PaletteColor::BRIGHT_GREEN static constexpr Uint8 MSG_COLOR = 8; // PaletteColor::GREEN - static constexpr float SLIDE_SPEED = 120.0F; + static constexpr float SLIDE_SPEED = 180.0F; // Constantes de consola static constexpr std::string_view CONSOLE_NAME = "JDD Console";