v3.2.0: made slight shape tweaks to tunnel rooms and small maze rooms
This commit is contained in:
@@ -36,13 +36,22 @@ public class MazeConnectionRoom extends ConnectionRoom {
|
|||||||
Maze.allowDiagonals = false;
|
Maze.allowDiagonals = false;
|
||||||
boolean[][] maze = Maze.generate(this);
|
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);
|
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++) {
|
for (int y = 0; y < maze[0].length; y++) {
|
||||||
if (maze[x][y] == Maze.FILLED) {
|
if (maze[x][y] == Maze.FILLED) {
|
||||||
Painter.fill(level, x + left, y + top, 1, 1, Terrain.WALL);
|
Painter.fill(level, x + left, y + top, 1, 1, Terrain.WALL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (Door door : connected.values()) {
|
for (Door door : connected.values()) {
|
||||||
door.set( Door.Type.HIDDEN );
|
door.set( Door.Type.HIDDEN );
|
||||||
|
|||||||
@@ -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
|
//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
|
//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);
|
Point p = new Point(c.left, c.top);
|
||||||
p.x += Random.Int(2) == 0 ? 1 : -1;
|
p.x += Random.Int(2) == 0 ? 1 : -1;
|
||||||
p.y += Random.Int(2) == 0 ? 1 : -1;
|
p.y += Random.Int(2) == 0 ? 1 : -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user