afegit a defaults la habitació i posició inicials (normal i debug)

This commit is contained in:
2026-03-08 10:09:30 +01:00
parent 2ae8fc7440
commit f2e45940d5
2 changed files with 28 additions and 7 deletions

View File

@@ -95,4 +95,29 @@ constexpr const char* TEXT = ""; // Texto del modo kiosko por defecto
constexpr bool INFINITE_LIVES = false; // Vidas infinitas en modo kiosko desactivadas por defecto constexpr bool INFINITE_LIVES = false; // Vidas infinitas en modo kiosko desactivadas por defecto
} // namespace Kiosk } // namespace Kiosk
// --- GAME (posición y habitación inicial) ---
namespace Game {
namespace Room {
#ifdef _DEBUG
constexpr const char* INITIAL = "51.yaml"; // Habitación de inicio en debug
#else
constexpr const char* INITIAL = "03.yaml"; // Habitación de inicio en release
#endif
} // namespace Room
namespace Player {
#ifdef _DEBUG
constexpr int SPAWN_X = 28 * Tile::SIZE; // Posición X inicial en debug
constexpr int SPAWN_Y = 10 * Tile::SIZE; // Posición Y inicial en debug
constexpr SDL_FlipMode SPAWN_FLIP = Flip::LEFT; // Orientación inicial en debug
#else
constexpr int SPAWN_X = 25 * Tile::SIZE; // Posición X inicial en release
constexpr int SPAWN_Y = 13 * Tile::SIZE; // Posición Y inicial en release
constexpr SDL_FlipMode SPAWN_FLIP = Flip::LEFT; // Orientación inicial en release
#endif
} // namespace Player
} // namespace Game
} // namespace Defaults } // namespace Defaults

View File

@@ -26,6 +26,7 @@
#include "game/ui/notifier.hpp" // Para Notifier, NotificationText, CHEEVO_NO... #include "game/ui/notifier.hpp" // Para Notifier, NotificationText, CHEEVO_NO...
#include "utils/defines.hpp" // Para Tile::SIZE, PlayArea::HEIGHT, RoomBorder::BOTTOM #include "utils/defines.hpp" // Para Tile::SIZE, PlayArea::HEIGHT, RoomBorder::BOTTOM
#include "utils/utils.hpp" // Para PaletteColor, stringToColor #include "utils/utils.hpp" // Para PaletteColor, stringToColor
#include "game/defaults.hpp" // Para Defaults::Game
#ifdef _DEBUG #ifdef _DEBUG
#include "core/system/debug.hpp" // Para Debug #include "core/system/debug.hpp" // Para Debug
@@ -38,13 +39,8 @@ Game::Game(Mode mode)
room_tracker_(std::make_shared<RoomTracker>()), room_tracker_(std::make_shared<RoomTracker>()),
stats_(std::make_shared<Stats>(Resource::List::get()->get("stats.csv"), Resource::List::get()->get("stats_buffer.csv"))), stats_(std::make_shared<Stats>(Resource::List::get()->get("stats.csv"), Resource::List::get()->get("stats_buffer.csv"))),
mode_(mode), mode_(mode),
#ifdef _DEBUG current_room_(Defaults::Game::Room::INITIAL),
current_room_("03.yaml"), spawn_data_(Player::SpawnData(Defaults::Game::Player::SPAWN_X, Defaults::Game::Player::SPAWN_Y, 0, 0, 0, Player::State::ON_GROUND, Defaults::Game::Player::SPAWN_FLIP))
spawn_data_(Player::SpawnData(25 * Tile::SIZE, 13 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, Flip::LEFT))
#else
current_room_("03.yaml"),
spawn_data_(Player::SpawnData(25 * Tile::SIZE, 13 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, Flip::LEFT))
#endif
{ {
// Crea objetos e inicializa variables // Crea objetos e inicializa variables
ItemTracker::init(); ItemTracker::init();