forked from jaildesigner-jailgames/jaildoctors_dilemma
canviat Options de struct a namespace
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
#include <SDL3/SDL.h>
|
||||
#include <stdlib.h> // Para rand
|
||||
|
||||
#include "core/resources/resource.hpp" // Para Resource
|
||||
#include "core/rendering/surface_animated_sprite.hpp" // Para SAnimatedSprite
|
||||
#include "utils/utils.hpp" // Para stringToColor
|
||||
#include "core/resources/resource.hpp" // Para Resource
|
||||
#include "utils/utils.hpp" // Para stringToColor
|
||||
|
||||
// Constructor
|
||||
Enemy::Enemy(const EnemyData& enemy)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "game/entities/item.hpp"
|
||||
|
||||
#include "core/resources/resource.hpp" // Para Resource
|
||||
#include "core/rendering/surface_sprite.hpp" // Para SSprite
|
||||
#include "core/resources/resource.hpp" // Para Resource
|
||||
|
||||
// Constructor
|
||||
Item::Item(ItemData item)
|
||||
|
||||
@@ -9,8 +9,8 @@ class SSprite;
|
||||
|
||||
struct ItemData {
|
||||
std::string tile_set_file; // Ruta al fichero con los gráficos del item
|
||||
float x; // Posición del item en pantalla
|
||||
float y; // Posición del item en pantalla
|
||||
float x; // Posición del item en pantalla
|
||||
float y; // Posición del item en pantalla
|
||||
int tile; // Número de tile dentro de la textura
|
||||
int counter; // Contador inicial. Es el que lo hace cambiar de color
|
||||
Uint8 color1; // Uno de los dos colores que se utiliza para el item
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
#include <algorithm> // Para max, min
|
||||
#include <cmath> // Para ceil, abs
|
||||
|
||||
#include "core/system/debug.hpp" // Para Debug
|
||||
#include "utils/defines.hpp" // Para RoomBorder::BOTTOM, RoomBorder::LEFT, RoomBorder::RIGHT
|
||||
#include "external/jail_audio.h" // Para JA_PlaySound
|
||||
#include "core/input/input.hpp" // Para Input, InputAction
|
||||
#include "game/gameplay/options.hpp" // Para Cheat, Options, options
|
||||
#include "core/resources/resource.hpp" // Para Resource
|
||||
#include "game/gameplay/room.hpp" // Para Room, TileType
|
||||
#include "core/input/input.hpp" // Para Input, InputAction
|
||||
#include "core/rendering/surface_animated_sprite.hpp" // Para SAnimatedSprite
|
||||
#include "core/resources/resource.hpp" // Para Resource
|
||||
#include "core/system/debug.hpp" // Para Debug
|
||||
#include "external/jail_audio.h" // Para JA_PlaySound
|
||||
#include "game/gameplay/options.hpp" // Para Cheat, Options, options
|
||||
#include "game/gameplay/room.hpp" // Para Room, TileType
|
||||
#include "utils/defines.hpp" // Para RoomBorder::BOTTOM, RoomBorder::LEFT, RoomBorder::RIGHT
|
||||
|
||||
// Constructor
|
||||
Player::Player(const PlayerData& player)
|
||||
@@ -218,8 +218,8 @@ void Player::applyGravity() {
|
||||
// Recalcula la posición del jugador y su animación
|
||||
void Player::move() {
|
||||
last_position_ = {x_, y_}; // Guarda la posicion actual antes de modificarla
|
||||
applyGravity(); // Aplica gravedad al jugador
|
||||
checkState(); // Comprueba el estado del jugador
|
||||
applyGravity(); // Aplica gravedad al jugador
|
||||
checkState(); // Comprueba el estado del jugador
|
||||
|
||||
#ifdef DEBUG
|
||||
debug_color_ = static_cast<Uint8>(PaletteColor::GREEN);
|
||||
@@ -549,9 +549,9 @@ bool Player::checkKillingTiles() {
|
||||
|
||||
// Establece el color del jugador
|
||||
void Player::setColor() {
|
||||
if (options.cheats.invincible == Cheat::CheatState::ENABLED) {
|
||||
if (Options::cheats.invincible == Options::Cheat::State::ENABLED) {
|
||||
color_ = static_cast<Uint8>(PaletteColor::CYAN);
|
||||
} else if (options.cheats.infinite_lives == Cheat::CheatState::ENABLED) {
|
||||
} else if (Options::cheats.infinite_lives == Options::Cheat::State::ENABLED) {
|
||||
color_ = static_cast<Uint8>(PaletteColor::YELLOW);
|
||||
} else {
|
||||
color_ = static_cast<Uint8>(PaletteColor::WHITE);
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
#include <string> // Para string
|
||||
#include <vector> // Para vector
|
||||
|
||||
#include "utils/defines.hpp" // Para BORDER_TOP, BLOCK
|
||||
#include "game/gameplay/room.hpp"
|
||||
#include "core/rendering/surface_animated_sprite.hpp" // Para SAnimatedSprite
|
||||
#include "utils/utils.hpp" // Para Color
|
||||
struct JA_Sound_t; // lines 13-13
|
||||
#include "game/gameplay/room.hpp"
|
||||
#include "utils/defines.hpp" // Para BORDER_TOP, BLOCK
|
||||
#include "utils/utils.hpp" // Para Color
|
||||
struct JA_Sound_t; // lines 13-13
|
||||
|
||||
enum class PlayerState {
|
||||
STANDING,
|
||||
|
||||
Reference in New Issue
Block a user