Implementadas las animaciones en el jugador
This commit is contained in:
@@ -24,16 +24,17 @@ private:
|
||||
int counter; // Contador para las animaciones
|
||||
};
|
||||
std::vector<t_animation> animation; // Vector con las diferentes animaciones
|
||||
int currentAnimation; // Animacion activa
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
AnimatedSprite(LTexture *texture = nullptr, SDL_Renderer *renderer = nullptr);
|
||||
AnimatedSprite(LTexture *texture = nullptr, SDL_Renderer *renderer = nullptr, std::string file="");
|
||||
|
||||
// Destructor
|
||||
~AnimatedSprite();
|
||||
|
||||
// Calcula el frame correspondiente a la animación
|
||||
void animate(std::string name);
|
||||
// Calcula el frame correspondiente a la animación actual
|
||||
void animate();
|
||||
|
||||
// Establece el frame actual de la animación
|
||||
void setCurrentFrame(std::string name, int num);
|
||||
@@ -61,6 +62,12 @@ public:
|
||||
|
||||
// Carga la animación desde un fichero
|
||||
bool load(std::string filePath);
|
||||
|
||||
// Establece la animacion actual
|
||||
void setCurrentAnimation(std::string name);
|
||||
|
||||
// Actualiza las variables del objeto
|
||||
void update();
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user