Modificado el nombre de algunas variables

This commit is contained in:
2022-09-24 19:38:31 +02:00
parent 8bdb2fdf29
commit df323dcd4d
22 changed files with 195 additions and 210 deletions

View File

@@ -1,14 +1,14 @@
tilemap=01.tmx
tileset_img=surface.png
enemy_file=01.ene
tileset=surface.png
enemyFile=01.ene
bgColor1=0,171,159
bgColor2=144,225,231
bgScroll=true
room_up=0
room_down=0
room_left=04.map
room_right=02.map
roomUp=0
roomDown=0
roomLeft=04.map
roomRight=02.map
[actors]

View File

@@ -1,11 +1,11 @@
tilemap=02.tmx
tileset_img=surface.png
enemy_file=02.ene
tileset=surface.png
enemyFile=02.ene
bgColor1=0,171,159
bgColor2=144,225,231
bgScroll=true
room_up=0
room_down=03.map
room_left=01.map
room_right=05.map
roomUp=0
roomDown=03.map
roomLeft=01.map
roomRight=05.map

View File

@@ -1,10 +1,10 @@
tilemap=03.tmx
tileset_img=surface.png
enemy_file=03.ene
tileset=surface.png
enemyFile=03.ene
bgColor1=143,86,59
bgColor2=69,40,60
room_up=02.map
room_down=0
room_left=0
room_right=06.map
roomUp=02.map
roomDown=0
roomLeft=0
roomRight=06.map

View File

@@ -1,10 +1,10 @@
tilemap=04.tmx
tileset_img=surface.png
tileset=surface.png
bgColor1=255,90,100
bgColor2=255,255,100
bgScroll=true
room_up=0
room_down=04.map
room_left=04.map
room_right=01.map
roomUp=0
roomDown=04.map
roomLeft=04.map
roomRight=01.map

View File

@@ -1,10 +1,10 @@
tilemap=05.tmx
tileset_img=surface.png
tileset=surface.png
bgColor1=0,171,159
bgColor2=144,225,231
bgScroll=true
room_up=0
room_down=06.map
room_left=02.map
room_right=07.map
roomUp=0
roomDown=06.map
roomLeft=02.map
roomRight=07.map

View File

@@ -1,9 +1,9 @@
tilemap=06.tmx
tileset_img=surface.png
tileset=surface.png
bgColor1=143,86,59
bgColor2=69,40,60
room_up=05.map
room_down=0
room_left=03.map
room_right=0
roomUp=05.map
roomDown=0
roomLeft=03.map
roomRight=0

View File

@@ -1,9 +1,9 @@
tilemap=07.tmx
tileset_img=surface.png
tileset=surface.png
bgColor1=0,171,159
bgColor2=144,225,231
room_up=08.map
room_down=0
room_left=05.map
room_right=0
roomUp=08.map
roomDown=0
roomLeft=05.map
roomRight=0

View File

@@ -1,9 +1,9 @@
tilemap=08.tmx
tileset_img=surface.png
tileset=surface.png
bgColor1=0,171,159
bgColor2=144,225,231
room_up=0
room_down=07.map
room_left=10.map
room_right=09.map
roomUp=0
roomDown=07.map
roomLeft=10.map
roomRight=09.map

View File

@@ -1,9 +1,9 @@
tilemap=09.tmx
tileset_img=surface.png
tileset=surface.png
bgColor1=0,171,159
bgColor2=144,225,231
room_up=0
room_down=0
room_left=08.map
room_right=0
roomUp=0
roomDown=0
roomLeft=08.map
roomRight=0

View File

@@ -1,9 +1,9 @@
tilemap=10.tmx
tileset_img=surface.png
tileset=surface.png
bgColor1=0,171,159
bgColor2=144,225,231
room_up=0
room_down=05.map
room_left=10.map
room_right=08.map
roomUp=0
roomDown=05.map
roomLeft=10.map
roomRight=08.map

View File

@@ -1,12 +1,12 @@
tileset_img=surface.png
enemy_file=01.ene
tileset=surface.png
enemyFile=01.ene
bgColor1=0,171,159
bgColor2=144,225,231
room_up=0
room_down=0
room_left=04.map
room_right=02.map
roomUp=0
roomDown=0
roomLeft=04.map
roomRight=02.map
[tilemap]
01.tmx

View File

@@ -1,12 +1,12 @@
tileset_img=surface.png
enemy_file=02.ene
tileset=surface.png
enemyFile=02.ene
bgColor1=0,171,159
bgColor2=144,225,231
room_up=0
room_down=03.map
room_left=01.map
room_right=05.map
roomUp=0
roomDown=03.map
roomLeft=01.map
roomRight=05.map
[tilemap]
02.tmx

View File

@@ -1,12 +1,12 @@
tileset_img=surface.png
enemy_file=03.ene
tileset=surface.png
enemyFile=03.ene
bgColor1=143,86,59
bgColor2=69,40,60
room_up=02.map
room_down=0
room_left=0
room_right=06.map
roomUp=02.map
roomDown=0
roomLeft=0
roomRight=06.map
[tilemap]
03.tmx

View File

@@ -1,11 +1,11 @@
tileset_img=surface.png
tileset=surface.png
bgColor1=0,171,159
bgColor2=144,225,231
room_up=0
room_down=04.map
room_left=04.map
room_right=01.map
roomUp=0
roomDown=04.map
roomLeft=04.map
roomRight=01.map
[tilemap]
04.tmx

View File

@@ -1,11 +1,11 @@
tileset_img=surface.png
tileset=surface.png
bgColor1=0,171,159
bgColor2=144,225,231
room_up=0
room_down=06.map
room_left=02.map
room_right=07.map
roomUp=0
roomDown=06.map
roomLeft=02.map
roomRight=07.map
[tilemap]
05.tmx

View File

@@ -1,11 +1,11 @@
tileset_img=surface.png
tileset=surface.png
bgColor1=143,86,59
bgColor2=69,40,60
room_up=05.map
room_down=0
room_left=03.map
room_right=0
roomUp=05.map
roomDown=0
roomLeft=03.map
roomRight=0
[tilemap]
06.tmx

View File

@@ -1,11 +1,11 @@
tileset_img=surface.png
tileset=surface.png
bgColor1=0,171,159
bgColor2=144,225,231
room_up=08.map
room_down=0
room_left=05.map
room_right=0
roomUp=08.map
roomDown=0
roomLeft=05.map
roomRight=0
[tilemap]
07.tmx

View File

@@ -1,11 +1,11 @@
tileset_img=surface.png
tileset=surface.png
bgColor1=0,171,159
bgColor2=144,225,231
room_up=0
room_down=07.map
room_left=10.map
room_right=09.map
roomUp=0
roomDown=07.map
roomLeft=10.map
roomRight=09.map
[tilemap]
08.tmx

View File

@@ -1,11 +1,11 @@
tileset_img=surface.png
tileset=surface.png
bgColor1=0,171,159
bgColor2=144,225,231
room_up=0
room_down=0
room_left=08.map
room_right=0
roomUp=0
roomDown=0
roomLeft=08.map
roomRight=0
[tilemap]
09.tmx

View File

@@ -1,11 +1,11 @@
tileset_img=surface.png
tileset=surface.png
bgColor1=0,171,159
bgColor2=144,225,231
room_up=0
room_down=05.map
room_left=10.map
room_right=08.map
roomUp=0
roomDown=05.map
roomLeft=10.map
roomRight=08.map
[tilemap]
10.tmx

View File

@@ -4,11 +4,11 @@
Map::Map(std::string file, SDL_Renderer *renderer, Asset *asset, ItemTracker *itemTracker)
{
// Inicializa variables
tile_size = 8;
map_width = 40;
map_height = 30;
tileSize = 8;
mapWidth = 40;
mapHeight = 30;
name = file.substr(file.find_last_of("\\/") + 1);
enemy_file = "";
enemyFile = "";
bgColor1 = bgColor2 = {0, 0, 0};
bgScroll = false;
counter = 0;
@@ -19,47 +19,45 @@ Map::Map(std::string file, SDL_Renderer *renderer, Asset *asset, ItemTracker *it
this->itemTracker = itemTracker;
// Crea las texturas para dibujar el mapa
map_layerBG = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, PLAY_AREA_WIDTH, PLAY_AREA_HEIGHT);
if (map_layerBG == NULL)
mapLayerBG = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, PLAY_AREA_WIDTH, PLAY_AREA_HEIGHT);
if (mapLayerBG == NULL)
{
printf("Error: map_layer0 could not be created!\nSDL Error: %s\n", SDL_GetError());
printf("Error: mapLayer0 could not be created!\nSDL Error: %s\n", SDL_GetError());
}
SDL_SetTextureBlendMode(map_layerBG, SDL_BLENDMODE_BLEND);
SDL_SetTextureBlendMode(mapLayerBG, SDL_BLENDMODE_BLEND);
map_layer0 = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, PLAY_AREA_WIDTH, PLAY_AREA_HEIGHT);
if (map_layer0 == NULL)
mapLayer0 = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, PLAY_AREA_WIDTH, PLAY_AREA_HEIGHT);
if (mapLayer0 == NULL)
{
printf("Error: map_layer0 could not be created!\nSDL Error: %s\n", SDL_GetError());
printf("Error: mapLayer0 could not be created!\nSDL Error: %s\n", SDL_GetError());
}
SDL_SetTextureBlendMode(map_layer0, SDL_BLENDMODE_BLEND);
// SDL_SetTextureAlphaMod(map_layer0, 128);
SDL_SetTextureBlendMode(mapLayer0, SDL_BLENDMODE_BLEND);
map_layer1 = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, PLAY_AREA_WIDTH, PLAY_AREA_HEIGHT);
if (map_layer1 == NULL)
mapLayer1 = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, PLAY_AREA_WIDTH, PLAY_AREA_HEIGHT);
if (mapLayer1 == NULL)
{
printf("Error: map_layer1 could not be created!\nSDL Error: %s\n", SDL_GetError());
printf("Error: mapLayer1 could not be created!\nSDL Error: %s\n", SDL_GetError());
}
SDL_SetTextureBlendMode(map_layer1, SDL_BLENDMODE_BLEND);
SDL_SetTextureBlendMode(mapLayer1, SDL_BLENDMODE_BLEND);
// Crea los objetos
loadMapFile(file);
texture_tile = new LTexture(renderer, asset->get(tileset_img));
tileset_width = texture_tile->getWidth() / tile_size;
textureTile = new LTexture(renderer, asset->get(tileset));
tilesetWidth = textureTile->getWidth() / tileSize;
loadMapTileFile(asset->get(tileMapFile));
// Pinta el mapa en las texturas
// fillMapTexture();
}
// Destructor
Map::~Map()
{
// Reclama la memoria utilizada por los objetos
texture_tile->unload();
delete texture_tile;
textureTile->unload();
delete textureTile;
SDL_DestroyTexture(map_layer1);
SDL_DestroyTexture(mapLayerBG);
SDL_DestroyTexture(mapLayer0);
SDL_DestroyTexture(mapLayer1);
for (auto actor : actors)
{
@@ -71,10 +69,7 @@ Map::~Map()
// Carga las variables desde un fichero de mapa
bool Map::loadMapFile(std::string file_path)
{
// Indicador de éxito en la carga
bool success = true;
std::string filename = file_path.substr(file_path.find_last_of("\\/") + 1);
const std::string filename = file_path.substr(file_path.find_last_of("\\/") + 1);
std::string line;
std::ifstream file(file_path);
@@ -111,7 +106,6 @@ bool Map::loadMapFile(std::string file_path)
if (!setActor(&actor, &p1, &p2, line.substr(0, pos), line.substr(pos + 1, line.length())))
{
printf("Warning: file %s\n, unknown parameter \"%s\"\n", filename.c_str(), line.substr(0, pos).c_str());
success = false;
}
} while (line != "[/moving platform]");
@@ -141,7 +135,6 @@ bool Map::loadMapFile(std::string file_path)
if (!setActor(&actor, &p1, &p2, line.substr(0, pos), line.substr(pos + 1, line.length())))
{
printf("Warning: file %s\n, unknown parameter \"%s\"\n", filename.c_str(), line.substr(0, pos).c_str());
success = false;
}
} while (line != "[/diamond]");
@@ -166,7 +159,6 @@ bool Map::loadMapFile(std::string file_path)
if (!setVars(line.substr(0, pos), line.substr(pos + 1, line.length())))
{
printf("Warning: file %s, unknown parameter \"%s\"\n", filename.c_str(), line.substr(0, pos).c_str());
success = false;
}
}
}
@@ -179,10 +171,10 @@ bool Map::loadMapFile(std::string file_path)
else
{
printf("Warning: Unable to open %s file\n", filename.c_str());
success = false;
return false;
}
return success;
return true;
}
// Lee la matriz de tiles desde un fichero tmx a un vector
@@ -230,22 +222,22 @@ bool Map::loadMapTileFile(std::string file_path)
if (line.find("name=\"estatico\"") != std::string::npos)
{
tilemap = readTilesFromFile(file);
fillGradientTexture(*map_layerBG);
fillMapTexture(*map_layerBG, tilemap, false);
fillGradientTexture(*mapLayerBG);
fillMapTexture(*mapLayerBG, tilemap, false);
tilemap.clear();
}
else if (line.find("name=\"fondo\"") != std::string::npos)
{
tilemap = readTilesFromFile(file);
fillMapTexture(*map_layer0, tilemap, true);
fillMapTexture(*mapLayer0, tilemap, true);
tilemap.clear();
}
else if (line.find("name=\"mapa\"") != std::string::npos)
{
tilemap = readTilesFromFile(file);
fillMapTexture(*map_layer1, tilemap, true);
fillMapTexture(*mapLayer1, tilemap, true);
tilemap.clear();
}
@@ -272,17 +264,14 @@ bool Map::loadMapTileFile(std::string file_path)
// Asigna variables a partir de dos cadenas
bool Map::setVars(std::string var, std::string value)
{
// Indicador de éxito en la asignación
bool success = true;
if (var == "tilemap")
{
tileMapFile = value;
}
else if (var == "tileset_img")
else if (var == "tileset")
{
tileset_img = value;
tileset = value;
}
else if (var == "bgColor1")
@@ -316,29 +305,29 @@ bool Map::setVars(std::string var, std::string value)
bgScroll = stringToBool(value);
}
else if (var == "room_up")
else if (var == "roomUp")
{
room_up = value;
roomUp = value;
}
else if (var == "room_down")
else if (var == "roomDown")
{
room_down = value;
roomDown = value;
}
else if (var == "room_left")
else if (var == "roomLeft")
{
room_left = value;
roomLeft = value;
}
else if (var == "room_right")
else if (var == "roomRight")
{
room_right = value;
roomRight = value;
}
else if (var == "enemy_file")
else if (var == "enemyFile")
{
enemy_file = value;
enemyFile = value;
}
else if (var == "")
@@ -347,18 +336,15 @@ bool Map::setVars(std::string var, std::string value)
else
{
success = false;
return false;
}
return success;
return true;
}
// Asigna variables a una estructura enemy_t
bool Map::setActor(actor_t *actor, SDL_Point *p1, SDL_Point *p2, std::string var, std::string value)
{
// Indicador de éxito en la asignación
bool success = true;
if (var == "tileset")
{
actor->tileset = value;
@@ -381,12 +367,12 @@ bool Map::setActor(actor_t *actor, SDL_Point *p1, SDL_Point *p2, std::string var
else if (var == "x")
{
actor->x = std::stof(value) * tile_size;
actor->x = std::stof(value) * tileSize;
}
else if (var == "y")
{
actor->y = std::stof(value) * tile_size;
actor->y = std::stof(value) * tileSize;
}
else if (var == "vx")
@@ -401,22 +387,22 @@ bool Map::setActor(actor_t *actor, SDL_Point *p1, SDL_Point *p2, std::string var
else if (var == "x1")
{
p1->x = std::stoi(value) * tile_size;
p1->x = std::stoi(value) * tileSize;
}
else if (var == "x2")
{
p2->x = std::stoi(value) * tile_size;
p2->x = std::stoi(value) * tileSize;
}
else if (var == "y1")
{
p1->y = std::stoi(value) * tile_size;
p1->y = std::stoi(value) * tileSize;
}
else if (var == "y2")
{
p2->y = std::stoi(value) * tile_size;
p2->y = std::stoi(value) * tileSize;
}
else if ((var == "[/moving platform]") || (var == "[/diamond]"))
@@ -425,10 +411,10 @@ bool Map::setActor(actor_t *actor, SDL_Point *p1, SDL_Point *p2, std::string var
else
{
success = false;
return false;
}
return success;
return true;
}
// Pinta el degradado en la textura
void Map::fillGradientTexture(SDL_Texture &layer)
@@ -437,11 +423,11 @@ void Map::fillGradientTexture(SDL_Texture &layer)
SDL_SetRenderTarget(renderer, &layer);
// Dibuja el degradado de fondo
const float num_lines = PLAY_AREA_BOTTOM - PLAY_AREA_TOP;
const float numLines = PLAY_AREA_BOTTOM - PLAY_AREA_TOP;
for (int i = PLAY_AREA_TOP; i < PLAY_AREA_BOTTOM; ++i)
{
float step = ((float)i / num_lines);
float step = ((float)i / numLines);
int r = bgColor1.r + ((bgColor2.r - bgColor1.r) * step);
int g = bgColor1.g + ((bgColor2.g - bgColor1.g) * step);
int b = bgColor1.b + ((bgColor2.b - bgColor1.b) * step);
@@ -457,7 +443,7 @@ void Map::fillGradientTexture(SDL_Texture &layer)
void Map::fillMapTexture(SDL_Texture &layer, std::vector<int> tilemap, bool clean)
{
// Crea variables
SDL_Rect clip = {0, 0, tile_size, tile_size};
SDL_Rect clip = {0, 0, tileSize, tileSize};
// Cambia el puntero del renderizador a la textura
SDL_SetRenderTarget(renderer, &layer);
@@ -470,15 +456,15 @@ void Map::fillMapTexture(SDL_Texture &layer, std::vector<int> tilemap, bool clea
}
// Dibuja el mapeado de tiles
for (int y = 0; y < map_height; ++y)
for (int x = 0; x < map_width; ++x)
for (int y = 0; y < mapHeight; ++y)
for (int x = 0; x < mapWidth; ++x)
{
// Resta uno porque Tiled almacena los indices empezando de 1 en vez de 0.
// El problema es que los tiles vacios los pone como 0 y aqui pasan a ser -1
// con lo que esta pintando desde fuera de la textura
clip.x = ((tilemap[(y * map_width) + x] - 1) % tileset_width) * tile_size;
clip.y = ((tilemap[(y * map_width) + x] - 1) / tileset_width) * tile_size;
texture_tile->render(renderer, x * tile_size, y * tile_size, &clip);
clip.x = ((tilemap[(y * mapWidth) + x] - 1) % tilesetWidth) * tileSize;
clip.y = ((tilemap[(y * mapWidth) + x] - 1) / tilesetWidth) * tileSize;
textureTile->render(renderer, x * tileSize, y * tileSize, &clip);
}
// Vuelve a colocar el renderizador apuntando a la pantalla
@@ -498,7 +484,7 @@ void Map::render()
void Map::renderLayerBG()
{
// Dibuja la textura con el mapa en pantalla
SDL_RenderCopy(renderer, map_layerBG, nullptr, nullptr);
SDL_RenderCopy(renderer, mapLayerBG, nullptr, nullptr);
}
// Dibuja la capa 0
@@ -514,12 +500,12 @@ void Map::renderLayer0()
SDL_Rect src2 = {PLAY_AREA_X + offset, PLAY_AREA_Y, PLAY_AREA_WIDTH - offset, PLAY_AREA_HEIGHT};
SDL_Rect dst2 = {PLAY_AREA_X, PLAY_AREA_Y, PLAY_AREA_WIDTH - offset, PLAY_AREA_HEIGHT};
SDL_RenderCopy(renderer, map_layer0, &src1, &dst1);
SDL_RenderCopy(renderer, map_layer0, &src2, &dst2);
SDL_RenderCopy(renderer, mapLayer0, &src1, &dst1);
SDL_RenderCopy(renderer, mapLayer0, &src2, &dst2);
}
else
{
SDL_RenderCopy(renderer, map_layer0, nullptr, nullptr);
SDL_RenderCopy(renderer, mapLayer0, nullptr, nullptr);
}
}
@@ -527,7 +513,7 @@ void Map::renderLayer0()
void Map::renderLayer1()
{
// Dibuja la textura con el mapa en pantalla
SDL_RenderCopy(renderer, map_layer1, nullptr, nullptr);
SDL_RenderCopy(renderer, mapLayer1, nullptr, nullptr);
}
// Dibuja los actores
@@ -558,7 +544,7 @@ e_tile_map Map::getTile(SDL_Point p)
const int y = std::max(getPlayArea(b_top), (std::min(p.y, getPlayArea(b_bottom) - 1)));
// Calcula el tile
const int tile = collisionmap[((y / tile_size) * map_width) + (x / tile_size)];
const int tile = collisionmap[((y / tileSize) * mapWidth) + (x / tileSize)];
if (tile == 0)
{
@@ -581,7 +567,7 @@ e_tile_map Map::getTile(SDL_Point p)
// Devuelve el valor de la variable
int Map::getTileSize()
{
return tile_size;
return tileSize;
}
// Devuelve el valor de los bordes de la zona de juego
@@ -598,11 +584,11 @@ int Map::getPlayArea(e_border border)
break;
case b_right:
return tile_size * map_width;
return tileSize * mapWidth;
break;
case b_bottom:
return tile_size * map_height;
return tileSize * mapHeight;
break;
default:
@@ -618,19 +604,19 @@ std::string Map::getRoomFileName(e_border border)
switch (border)
{
case b_top:
return room_up;
return roomUp;
break;
case b_left:
return room_left;
return roomLeft;
break;
case b_right:
return room_right;
return roomRight;
break;
case b_bottom:
return room_down;
return roomDown;
break;
default:
@@ -737,12 +723,11 @@ void Map::getItem(int index)
// Obtiene el valor de la variable
std::string Map::getEnemyFile()
{
return enemy_file;
return enemyFile;
}
// Recarga las texturas
void Map::reLoadTextures()
{
texture_tile->reLoad();
// fillMapTexture();
textureTile->reLoad();
}

View File

@@ -38,18 +38,18 @@ private:
Asset *asset; // Objeto con la ruta a todos los ficheros de recursos
SDL_Renderer *renderer; // El renderizador de la ventana
std::string name; // Identificador de la habitación
std::string room_up; // Identificador de la habitación que se encuentra arriba
std::string room_down; // Identificador de la habitación que se encuentra abajp
std::string room_left; // Identificador de la habitación que se encuentra a la izquierda
std::string room_right; // Identificador de la habitación que se encuentra a la derecha
std::string enemy_file; // Fichero con los enemigos para la habitación
std::string tileset_img; // Imagen con los graficos para la habitación
std::string roomUp; // Identificador de la habitación que se encuentra arriba
std::string roomDown; // Identificador de la habitación que se encuentra abajp
std::string roomLeft; // Identificador de la habitación que se encuentra a la izquierda
std::string roomRight; // Identificador de la habitación que se encuentra a la derecha
std::string enemyFile; // Fichero con los enemigos para la habitación
std::string tileset; // Imagen con los graficos para la habitación
std::string tileMapFile; // Fichero con el mapa de indices de tile
std::vector<int> collisionmap; // Indice con los tipos de tile de la habitación
LTexture *texture_tile; // Textura con los graficos de los tiles habitación
SDL_Texture *map_layerBG; // Textura para dibujar la capa BG del mapa de la habitación
SDL_Texture *map_layer0; // Textura para dibujar la capa 0 del mapa de la habitación
SDL_Texture *map_layer1; // Textura para dibujar la capa 1 del mapa de la habitación
LTexture *textureTile; // Textura con los graficos de los tiles habitación
SDL_Texture *mapLayerBG; // Textura para dibujar la capa BG del mapa de la habitación
SDL_Texture *mapLayer0; // Textura para dibujar la capa 0 del mapa de la habitación
SDL_Texture *mapLayer1; // Textura para dibujar la capa 1 del mapa de la habitación
std::vector<Actor *> actors; // Listado con los actores de la habitación
color_t bgColor1; // Color superior del degradado de fondo
color_t bgColor2; // Color inferior del degradado de fondo
@@ -57,10 +57,10 @@ private:
ItemTracker *itemTracker; // Objeto que gestiona los items que ya se han recogido
int counter; // Contador para lo que se necesite
int tile_size; // Ancho del tile en pixels
int map_width; // Ancho del mapa en tiles
int map_height; // Alto del mapa en tiles
int tileset_width; // Ancho del tileset en tiles
int tileSize; // Ancho del tile en pixels
int mapWidth; // Ancho del mapa en tiles
int mapHeight; // Alto del mapa en tiles
int tilesetWidth; // Ancho del tileset en tiles
// Carga las variables desde un fichero de mapa
bool loadMapFile(std::string file);