Transició a surface: barallantme amb tots els Color que hi ha pel codi

This commit is contained in:
2025-03-03 22:58:12 +01:00
parent b940d627d6
commit c4033e3663
20 changed files with 219 additions and 224 deletions

View File

@@ -5,7 +5,7 @@
#include <memory> // for shared_ptr, __shared_ptr_access
#include <string> // for string
#include <vector> // for vector
#include "s_animated_sprite.h" // for AnimatedSprite
#include "s_animated_sprite.h" // for SAnimatedSprite
#include "defines.h" // for BORDER_TOP, BLOCK
#include "surface.h" // for Texture
#include "utils.h" // for Color
@@ -60,14 +60,14 @@ public:
// Objetos y punteros
std::shared_ptr<Room> room_; // Objeto encargado de gestionar cada habitación del juego
std::shared_ptr<AnimatedSprite> sprite_; // Sprite del jugador
std::shared_ptr<SAnimatedSprite> sprite_; // Sprite del jugador
// Variables
float x_; // Posición del jugador en el eje X
float y_; // Posición del jugador en el eje Y
float vx_; // Velocidad/desplazamiento del jugador en el eje X
float vy_; // Velocidad/desplazamiento del jugador en el eje Y
Color color_; // Color del jugador
Uint8 color_; // Color del jugador
SDL_Rect collider_box_; // Caja de colisión con los enemigos u objetos
std::vector<SDL_Point> collider_points_; // Puntos de colisión con el mapa
std::vector<SDL_Point> under_feet_; // Contiene los puntos que hay bajo cada pie del jugador
@@ -189,9 +189,6 @@ public:
// Obtiene el estado de reaparición del jugador
PlayerSpawn getSpawnParams() { return {x_, y_, vx_, vy_, jump_init_pos_, state_, sprite_->getFlip()}; }
// Recarga la textura
void reLoadTexture() { sprite_->getTexture()->reLoad(); }
// Establece el color del jugador
void setColor();