v0.5.0: more improvements to tile maps
adjusted which tiles are rendered fixed bugs involving secret doors
This commit is contained in:
parent
5d7ffe4203
commit
bdf2553c30
|
@ -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])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -193,15 +193,15 @@ 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_DECO) result = RAISED_WALL_DECO;
|
||||
else return -1;
|
||||
if (doorTiles.contains(below)) result = RAISED_WALL_DOOR;
|
||||
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;
|
||||
|
||||
result = getVisualWithAlts(result, pos);
|
||||
|
||||
if (!wallStitcheable.contains(right)) result += 1;
|
||||
if (!wallStitcheable.contains(left)) result += 2;
|
||||
if (!wallStitcheable.contains(right)) result += 1;
|
||||
if (!wallStitcheable.contains(left)) result += 2;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user