v3.2.0: made slight shape tweaks to tunnel rooms and small maze rooms

This commit is contained in:
Evan Debenham
2025-06-24 14:41:17 -04:00
parent 2135831b56
commit 0e0e06b384
2 changed files with 13 additions and 4 deletions

View File

@@ -36,13 +36,22 @@ public class MazeConnectionRoom extends ConnectionRoom {
Maze.allowDiagonals = false;
boolean[][] maze = Maze.generate(this);
//if we're a small maze, ensure we generated a pattern with a filled center
// this increases the likelihood of things looking mazey
while (width() >= 5 && height() >= 5
&& (width() <= 7 || height() <= 7)
&& maze[width() / 2][height() / 2] == Maze.EMPTY) {
maze = Maze.generate(this);
}
Painter.fill(level, this, 1, Terrain.EMPTY);
for (int x = 0; x < maze.length; x++)
for (int x = 0; x < maze.length; x++){
for (int y = 0; y < maze[0].length; y++) {
if (maze[x][y] == Maze.FILLED) {
Painter.fill(level, x + left, y + top, 1, 1, Terrain.WALL);
}
}
}
for (Door door : connected.values()) {
door.set( Door.Type.HIDDEN );

View File

@@ -78,7 +78,7 @@ public class TunnelRoom extends ConnectionRoom {
//fill in an extra diagonal tile at center randomly if we're a larger room with many connections
//this makes the shape a bit more varied in these cases
if (width() >= 7 && height() >= 7 && connected.size() > 4 && c.square() == 0){
if (width() >= 7 && height() >= 7 && connected.size() >= 4 && c.square() == 0){
Point p = new Point(c.left, c.top);
p.x += Random.Int(2) == 0 ? 1 : -1;
p.y += Random.Int(2) == 0 ? 1 : -1;