El jugador ya empieza a moverse

This commit is contained in:
2022-08-12 12:29:35 +02:00
parent 2740ae9b7e
commit 0afc0cf629
4 changed files with 55 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
#include <SDL2/SDL.h>
#include "jail_audio.h"
#include "utils.h"
#include "input.h"
#include "animatedsprite.h"
#include "asset.h"
@@ -14,6 +15,7 @@ class Player
private:
Asset *asset; // Objeto con la ruta a todos los ficheros de recursos
SDL_Renderer *renderer; // El renderizador de la ventana
Input *input; // Objeto Input para gestionar las entradas
AnimatedSprite *sprite; // Objeto con los graficos, animaciones y posición del jugador
LTexture *texture; // Textura con los graficos del jugador
@@ -40,9 +42,12 @@ private:
Uint8 lifes; // Cantidad de vidas
Uint8 respawn_direction; // Dirección para revivir
// Comprueba las entradas y modifica variables
void checkInput();
public:
// Constructor
Player(SDL_Renderer *renderer, Asset *asset);
Player(SDL_Renderer *renderer, Asset *asset, Input *input);
// Destructor
~Player();