Trabajando en las colisiones

This commit is contained in:
2022-08-16 13:54:22 +02:00
parent 77980a4d70
commit a941f72208
7 changed files with 140 additions and 20 deletions

View File

@@ -12,6 +12,13 @@
#ifndef MAP_H
#define MAP_H
enum t_tile_map
{
nothing,
wall,
travessable
};
// The player
class Map
{
@@ -29,6 +36,10 @@ private:
LTexture *texture_bg; // Textura con los graficos de fondo de la habitación
SDL_Texture *map_texture; // Textura para dibujar el mapa de la habitación
int tile_width; // Ancho del tile en pixels
int map_width; // Alto del mapa en tiles
int map_height; // Ancho del mapa en tiles
// Carga las variables desde un fichero
bool load(std::string file);
@@ -50,6 +61,9 @@ public:
// Dibuja el objeto
void render();
// Devuelve el tipo de tile que hay en un punto
t_tile_map getTile(SDL_Point p);
};
#endif