Trabajando en las colisiones con los enemigos
This commit is contained in:
@@ -92,7 +92,7 @@ bool Map::load(std::string file_path)
|
||||
{
|
||||
std::getline(file2, line);
|
||||
pos = line.find("data encoding");
|
||||
} while (pos == std::string::npos);
|
||||
} while (pos == (int)std::string::npos);
|
||||
|
||||
do
|
||||
{ // Se introducen los valores separados por comas en un vector
|
||||
@@ -117,7 +117,7 @@ bool Map::load(std::string file_path)
|
||||
{
|
||||
std::getline(file2, line);
|
||||
pos = line.find("data encoding");
|
||||
} while (pos == std::string::npos);
|
||||
} while (pos == (int)std::string::npos);
|
||||
|
||||
do
|
||||
{ // Se introducen los valores separados por comas en un vector
|
||||
@@ -142,7 +142,7 @@ bool Map::load(std::string file_path)
|
||||
{
|
||||
std::getline(file2, line);
|
||||
pos = line.find("data encoding");
|
||||
} while (pos == std::string::npos);
|
||||
} while (pos == (int)std::string::npos);
|
||||
|
||||
do
|
||||
{ // Se introducen los valores separados por comas en un vector
|
||||
@@ -438,7 +438,7 @@ void Map::fillMapTexture()
|
||||
// Dibuja el degradado de fondo
|
||||
const float num_lines = PLAY_AREA_BOTTOM - PLAY_AREA_TOP;
|
||||
|
||||
for (int i = PLAY_AREA_TOP; i < PLAY_AREA_BOTTOM; i++)
|
||||
for (int i = PLAY_AREA_TOP; i < PLAY_AREA_BOTTOM; ++i)
|
||||
{
|
||||
float step = ((float)i / num_lines);
|
||||
int r = bgColor1.r + ((bgColor2.r - bgColor1.r) * step);
|
||||
@@ -449,8 +449,8 @@ void Map::fillMapTexture()
|
||||
}
|
||||
|
||||
// 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 < map_height; ++y)
|
||||
for (int x = 0; x < map_width; ++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
|
||||
@@ -469,8 +469,8 @@ void Map::fillMapTexture()
|
||||
SDL_RenderClear(renderer);
|
||||
|
||||
// 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 < map_height; ++y)
|
||||
for (int x = 0; x < map_width; ++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
|
||||
@@ -511,8 +511,8 @@ void Map::renderLayer0()
|
||||
}
|
||||
else
|
||||
{
|
||||
SDL_Rect rect = {PLAY_AREA_X, PLAY_AREA_Y, PLAY_AREA_WIDTH, PLAY_AREA_HEIGHT};
|
||||
SDL_RenderCopy(renderer, map_layer0, nullptr, nullptr);
|
||||
//SDL_Rect rect = {PLAY_AREA_X, PLAY_AREA_Y, PLAY_AREA_WIDTH, PLAY_AREA_HEIGHT};
|
||||
SDL_RenderCopy(renderer, map_layer0, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user