forked from jaildesigner-jailgames/jaildoctors_dilemma
Ya funcionan los tiles atravesables
This commit is contained in:
@@ -308,18 +308,24 @@ std::string Room::getRoom(int border)
|
||||
return "";
|
||||
}
|
||||
|
||||
// Indica si el tile al que pertenece el pixel es sólido o no
|
||||
bool Room::isFloor(SDL_Point point)
|
||||
// Devuelve el tipo de tile que hay en ese pixel
|
||||
int Room::getTile(SDL_Point point)
|
||||
{
|
||||
int tile = ((point.y / 8) * 32) + (point.x / 8);
|
||||
|
||||
if (tile < 512)
|
||||
int pos = ((point.y / 8) * 32) + (point.x / 8);
|
||||
int tile = TILE_EMPTY;
|
||||
|
||||
if (pos < 512)
|
||||
{
|
||||
if (tilemap[tile] != 0)
|
||||
if (tilemap[pos] == 41)
|
||||
{
|
||||
return true;
|
||||
return TILE_SOLID;
|
||||
}
|
||||
|
||||
if (tilemap[pos] == 81)
|
||||
{
|
||||
return TILE_TRAVESSABLE;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return tile;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user