Trabajando en integrar el objeto asset y mejorar los objetos player y map
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "animatedsprite.h"
|
||||
#include "asset.h"
|
||||
#include "jail_audio.h"
|
||||
#include "utils.h"
|
||||
|
||||
@@ -9,25 +10,6 @@
|
||||
// The player
|
||||
class Player
|
||||
{
|
||||
public:
|
||||
// Constructor
|
||||
Player(SDL_Renderer *renderer, LTexture *texture);
|
||||
|
||||
// Destructor
|
||||
~Player();
|
||||
|
||||
// Inicializa todas las variables
|
||||
void init(SDL_Renderer *renderer, LTexture *texture);
|
||||
|
||||
// Resetea ciertas variables
|
||||
void reset();
|
||||
|
||||
// Actualiza todas las variables
|
||||
void update();
|
||||
|
||||
// Dibuja el objeto
|
||||
void render();
|
||||
|
||||
private:
|
||||
bool can_jump; // Si puede saltar
|
||||
bool enabled; // Si está habilitado
|
||||
@@ -48,10 +30,31 @@ private:
|
||||
JA_Sound sound_jump; // Sonido al saltar
|
||||
SDL_Rect rect; // Rectangulo con la posición del jugador
|
||||
AnimatedSprite *sprite; // Sprite con los graficos y animaciones
|
||||
Asset *asset; // Objeto con los ficheros de recursos
|
||||
LTexture *texture; // Objeto con los gráficos del jugador
|
||||
Uint8 active_animation; // Animación activa
|
||||
Uint8 direction; // Sentido del desplazamiento
|
||||
Uint8 lifes; // Cantidad de vidas
|
||||
Uint8 respawn_direction; // Dirección para revivir
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Player(SDL_Renderer *renderer, Asset *asset);
|
||||
|
||||
// Destructor
|
||||
~Player();
|
||||
|
||||
// Inicializa todas las variables
|
||||
void init();
|
||||
|
||||
// Resetea ciertas variables
|
||||
void reset();
|
||||
|
||||
// Actualiza todas las variables
|
||||
void update();
|
||||
|
||||
// Dibuja el objeto
|
||||
void render();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user