Cambiado el constructor de la clase Player

This commit is contained in:
2022-10-31 07:38:48 +01:00
parent cb6050183b
commit aa3c7a4b80
4 changed files with 46 additions and 32 deletions

View File

@@ -22,7 +22,7 @@ enum state_e
s_falling
};
struct player_t
struct playerSpawn_t
{
float x;
float y;
@@ -33,6 +33,20 @@ struct player_t
SDL_RendererFlip flip;
};
struct player_t
{
playerSpawn_t spawn;
std::string png;
std::string animation;
SDL_Renderer *renderer;
Resource *resource;
Asset *asset;
options_t *options;
Input *input;
Room *room;
Debug *debug;
};
class Player
{
public:
@@ -42,7 +56,6 @@ public:
Resource *resource; // Objeto con los recursos
Asset *asset; // Objeto con la ruta a todos los ficheros de recursos
Room *room; // Objeto encargado de gestionar cada habitación del juego
//Texture *texture; // Textura con los graficos del enemigo
AnimatedSprite *sprite; // Sprite del enemigo
Debug *debug; // Objeto para gestionar la información de debug
options_t *options; // Puntero a las opciones del juego
@@ -130,7 +143,7 @@ public:
public:
// Constructor
Player(player_t ini, std::string png, std::string animation, SDL_Renderer *renderer, Resource *resource, Asset *asset, options_t *options, Input *input, Room *room, Debug *debug);
Player(player_t player);
// Destructor
~Player();
@@ -157,7 +170,7 @@ public:
SDL_Rect &getCollider();
// Obtiene algunos parametros del jugador
player_t getSpawnParams();
playerSpawn_t getSpawnParams();
// Recarga la textura
void reLoadTexture();