Colision con el suelo terminada

This commit is contained in:
2022-07-06 21:04:45 +02:00
parent edba97cfc7
commit 90bbe77f39
6 changed files with 82 additions and 10 deletions

View File

@@ -3,6 +3,7 @@
#include "const.h"
#include "utils.h"
#include "asset.h"
#include "room.h"
#include "animatedsprite.h"
#include "input.h"
#include <string>
@@ -18,7 +19,8 @@ class Player
private:
LTexture *texture; // Textura con los graficos del enemigo
AnimatedSprite *sprite; // Sprite del enemigo
Input *input; // Objeto para gestyionar la entrada
Input *input; // Objeto para gestionar la entrada
Room *room; // Objeto con el mapa del juego
SDL_Renderer *renderer; // El renderizador de la ventana
Asset *asset; // Objeto con la ruta a todos los ficheros de recursos
@@ -35,7 +37,7 @@ private:
public:
// Constructor
Player(std::string _tileset, SDL_Renderer *_renderer, Asset *_asset, Input *_input);
Player(std::string _tileset, SDL_Renderer *_renderer, Asset *_asset, Input *_input, Room *_room);
// Destructor
~Player();
@@ -54,6 +56,18 @@ public:
// Cambia al jugador de un borde al opuesto. Util para el cambio de pantalla
void switchBorders();
// Establece el valor de la variable
void setRoom(Room *_room);
// Obtiene el valor del pixel inferior izquierdo del jugador
SDL_Point getLeftFoot();
// Obtiene el valor del pixel inferior derecho del jugador
SDL_Point getRightFoot();
// Establece la velocidad en el eje Y al jugador
void setFalling(bool value);
};
#endif