mini-merdes

This commit is contained in:
2025-11-21 17:35:33 +01:00
parent 039eb20c06
commit d011a41d5a
4 changed files with 26 additions and 33 deletions

View File

@@ -18,9 +18,6 @@
#include "core/resources/resource_helper.hpp" // Para ResourceHelper #include "core/resources/resource_helper.hpp" // Para ResourceHelper
#include "core/resources/resource_list.hpp" // Para Asset, AssetType #include "core/resources/resource_list.hpp" // Para Asset, AssetType
#include "core/resources/resource_loader.hpp" // Para ResourceLoader #include "core/resources/resource_loader.hpp" // Para ResourceLoader
#ifdef _DEBUG
#include "core/system/debug.hpp" // Para Debug
#endif
#include "game/gameplay/cheevos.hpp" // Para Cheevos #include "game/gameplay/cheevos.hpp" // Para Cheevos
#include "game/options.hpp" // Para Options, options, OptionsVideo #include "game/options.hpp" // Para Options, options, OptionsVideo
#include "game/scene_manager.hpp" // Para SceneManager #include "game/scene_manager.hpp" // Para SceneManager
@@ -35,6 +32,10 @@
#include "game/ui/notifier.hpp" // Para Notifier #include "game/ui/notifier.hpp" // Para Notifier
#include "utils/defines.hpp" // Para WINDOW_CAPTION #include "utils/defines.hpp" // Para WINDOW_CAPTION
#ifdef _DEBUG
#include "core/system/debug.hpp" // Para Debug
#endif
#ifndef _WIN32 #ifndef _WIN32
#include <pwd.h> #include <pwd.h>
#endif #endif

View File

@@ -65,7 +65,7 @@ constexpr bool ENABLED = true; // Sonido habilitado por defecto
// --- CHEATS --- // --- CHEATS ---
namespace Cheat { namespace Cheat {
constexpr bool INFINITE_LIVES = false; // Vidas infinitas desactivadas por defecto constexpr bool INFINITE_LIVES = false; // Vidas infinitas desactivadas por defecto
constexpr bool INVINCIBLE = true; // Invencibilidad desactivada por defecto constexpr bool INVINCIBLE = false; // Invencibilidad desactivada por defecto
constexpr bool JAIL_IS_OPEN = false; // Jail abierta desactivada por defecto constexpr bool JAIL_IS_OPEN = false; // Jail abierta desactivada por defecto
constexpr bool ALTERNATE_SKIN = false; // Skin alternativa desactivada por defecto constexpr bool ALTERNATE_SKIN = false; // Skin alternativa desactivada por defecto
} // namespace Cheat } // namespace Cheat

View File

@@ -22,12 +22,6 @@ struct KeyboardControls {
}; };
// Estructura para las opciones de control del gamepad/joystick // Estructura para las opciones de control del gamepad/joystick
// Los valores pueden ser:
// - 0-20+: Botones SDL_GamepadButton (DPAD, face buttons, shoulders, etc.)
// - 100: L2 trigger
// - 101: R2 trigger
// - 200: Left stick X axis (negativo = izquierda)
// - 201: Left stick X axis (positivo = derecha)
struct GamepadControls { struct GamepadControls {
int button_left{Defaults::Controls::GAMEPAD_BUTTON_LEFT}; // Botón para mover a la izquierda (por defecto: DPAD_LEFT) int button_left{Defaults::Controls::GAMEPAD_BUTTON_LEFT}; // Botón para mover a la izquierda (por defecto: DPAD_LEFT)
int button_right{Defaults::Controls::GAMEPAD_BUTTON_RIGHT}; // Botón para mover a la derecha (por defecto: DPAD_RIGHT) int button_right{Defaults::Controls::GAMEPAD_BUTTON_RIGHT}; // Botón para mover a la derecha (por defecto: DPAD_RIGHT)
@@ -48,9 +42,7 @@ struct Cheat {
// Método para comprobar si alguno de los tres primeros trucos está activo // Método para comprobar si alguno de los tres primeros trucos está activo
[[nodiscard]] auto enabled() const -> bool { [[nodiscard]] auto enabled() const -> bool {
return infinite_lives == State::ENABLED || return infinite_lives == State::ENABLED || invincible == State::ENABLED || jail_is_open == State::ENABLED;
invincible == State::ENABLED ||
jail_is_open == State::ENABLED;
} }
}; };
@@ -114,7 +106,7 @@ struct Game {
float height{Defaults::Canvas::HEIGHT}; // Alto de la resolucion del juego float height{Defaults::Canvas::HEIGHT}; // Alto de la resolucion del juego
}; };
// --- Variables globales (inline C++17+) --- // --- Variables globales ---
inline std::string version{}; // Versión del fichero de configuración. Sirve para saber si las opciones son compatibles inline std::string version{}; // Versión del fichero de configuración. Sirve para saber si las opciones son compatibles
inline bool console{false}; // Indica si ha de mostrar información por la consola de texto inline bool console{false}; // Indica si ha de mostrar información por la consola de texto
inline Cheat cheats{}; // Contiene trucos y ventajas para el juego inline Cheat cheats{}; // Contiene trucos y ventajas para el juego

View File

@@ -39,10 +39,10 @@ Game::Game(Mode mode)
mode_(mode), mode_(mode),
#ifdef _DEBUG #ifdef _DEBUG
current_room_("03.yaml"), current_room_("03.yaml"),
spawn_data_(Player::SpawnData(25 * Tile::SIZE, 13 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, SDL_FLIP_HORIZONTAL)) spawn_data_(Player::SpawnData(25 * Tile::SIZE, 13 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, Flip::LEFT))
#else #else
current_room_("03.yaml"), current_room_("03.yaml"),
spawn_data_(Player::SpawnData(25 * Tile::SIZE, 13 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, SDL_FLIP_HORIZONTAL)) spawn_data_(Player::SpawnData(25 * Tile::SIZE, 13 * Tile::SIZE, 0, 0, 0, Player::State::ON_GROUND, Flip::LEFT))
#endif #endif
{ {
// Crea objetos e inicializa variables // Crea objetos e inicializa variables