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 (!flat) {
|
||||||
if ((DungeonTileSheet.doorTiles.contains(tile))) {
|
if ((DungeonTileSheet.doorTiles.contains(tile))) {
|
||||||
return DungeonTileSheet.getRaisedDoorTile(tile, map[pos - mapWidth]);
|
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(
|
return DungeonTileSheet.getRaisedWallTile(
|
||||||
tile,
|
tile,
|
||||||
pos,
|
pos,
|
||||||
|
@ -65,7 +65,11 @@ public class DungeonTerrainTilemap extends DungeonTilemap {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean needsRender(int pos) {
|
protected boolean needsRender(int pos) {
|
||||||
return (Level.discoverable[pos] || data[pos] == DungeonTileSheet.CHASM)
|
return data[pos] != DungeonTileSheet.WATER ||
|
||||||
&& 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){
|
public static int getRaisedWallTile(int tile, int pos, int right, int below, int left){
|
||||||
int result;
|
int result;
|
||||||
if (doorTiles.contains(below)) result = RAISED_WALL_DOOR;
|
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 if (tile == Terrain.WALL_DECO) result = RAISED_WALL_DECO;
|
||||||
else return -1;
|
else return -1;
|
||||||
|
|
||||||
result = getVisualWithAlts(result, pos);
|
result = getVisualWithAlts(result, pos);
|
||||||
|
|
||||||
if (!wallStitcheable.contains(right)) result += 1;
|
if (!wallStitcheable.contains(right)) result += 1;
|
||||||
if (!wallStitcheable.contains(left)) result += 2;
|
if (!wallStitcheable.contains(left)) result += 2;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,6 @@ public class DungeonWallsTilemap extends DungeonTilemap {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean needsRender(int pos) {
|
protected boolean needsRender(int pos) {
|
||||||
return data[pos] != -1 && Level.discoverable[pos];
|
return data[pos] != -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user