v0.5.0: more improvements to tile maps

adjusted which tiles are rendered
fixed bugs involving secret doors
This commit is contained in:
Evan Debenham 2016-12-12 15:34:13 -05:00
parent 5d7ffe4203
commit bdf2553c30
3 changed files with 14 additions and 10 deletions

View File

@ -38,7 +38,7 @@ public class DungeonTerrainTilemap extends DungeonTilemap {
if (!flat) {
if ((DungeonTileSheet.doorTiles.contains(tile))) {
return DungeonTileSheet.getRaisedDoorTile(tile, map[pos - mapWidth]);
} else if (tile == Terrain.WALL || tile == Terrain.WALL_DECO){
} else if (tile == Terrain.WALL || tile == Terrain.WALL_DECO || tile == Terrain.SECRET_DOOR){
return DungeonTileSheet.getRaisedWallTile(
tile,
pos,
@ -65,7 +65,11 @@ public class DungeonTerrainTilemap extends DungeonTilemap {
@Override
protected boolean needsRender(int pos) {
return (Level.discoverable[pos] || data[pos] == DungeonTileSheet.CHASM)
&& data[pos] != DungeonTileSheet.WATER;
return data[pos] != DungeonTileSheet.WATER ||
(
pos + mapWidth < size &&
DungeonTileSheet.wallStitcheable.contains(map[pos]) &&
DungeonTileSheet.wallStitcheable.contains(map[pos + mapWidth])
);
}
}

View File

@ -194,7 +194,7 @@ public class DungeonTileSheet {
public static int getRaisedWallTile(int tile, int pos, int right, int below, int left){
int result;
if (doorTiles.contains(below)) result = RAISED_WALL_DOOR;
else if (tile == Terrain.WALL) result = RAISED_WALL;
else if (tile == Terrain.WALL || tile == Terrain.SECRET_DOOR) result = RAISED_WALL;
else if (tile == Terrain.WALL_DECO) result = RAISED_WALL_DECO;
else return -1;

View File

@ -92,6 +92,6 @@ public class DungeonWallsTilemap extends DungeonTilemap {
@Override
protected boolean needsRender(int pos) {
return data[pos] != -1 && Level.discoverable[pos];
return data[pos] != -1;
}
}