Terminados los tiles atravesables
This commit is contained in:
@@ -226,13 +226,13 @@ void Map::render()
|
||||
t_tile_map Map::getTile(SDL_Point p)
|
||||
{
|
||||
const int tile = tilemap[((p.y / tile_size) * map_width) + (p.x / tile_size)];
|
||||
const int png_width = 16 * 2;
|
||||
const int png_width = 32;
|
||||
|
||||
if (tile >= 0 && tile < 4 * 2 * png_width)
|
||||
if (tile >= 0 && tile < 8 * png_width)
|
||||
{
|
||||
return nothing;
|
||||
}
|
||||
else if (tile >= (4 * 2 * png_width) && tile < 8 * 2 * png_width)
|
||||
else if (tile >= (8 * png_width) && tile < 16 * png_width)
|
||||
{
|
||||
return wall;
|
||||
}
|
||||
@@ -246,4 +246,10 @@ t_tile_map Map::getTile(SDL_Point p)
|
||||
int Map::getTileSize()
|
||||
{
|
||||
return tile_size;
|
||||
}
|
||||
|
||||
// Devuelve el indice del tile correspondiente a un punto del mapa
|
||||
int Map::getTileIndex(SDL_Point p)
|
||||
{
|
||||
return tilemap[((p.y / tile_size) * map_width) + (p.x / tile_size)];
|
||||
}
|
||||
Reference in New Issue
Block a user