private void Town(int x, int y, int size) { AreaGen area = new AreaGen(); area.MazeGen(size, 8, false, 3, 1, 0.1, 0); for (int i = 0; i < area.Width; i++) { for (int j = 0; j < area.Height; j++) { switch (area.GetTileType(i, j)) { case AreaTileType.Depth: break; case AreaTileType.Ground: SetGround(x - area.Center.X + i, y - area.Center.Y + j, GroundTileType.Street); break; case AreaTileType.Wall: SetGround(x - area.Center.X + i, y - area.Center.Y + j, GroundTileType.Building); break; default: break; } } } }
private void Sea2(int x, int y, int size) { AreaGen area = new AreaGen(); area.MazeGen(size, 5, false, 1, 1, 1, 0); for (int i = 0; i < area.Width; i++) { for (int j = 0; j < area.Height; j++) { int worldX = x - area.Center.X + i; int worldY = y - area.Center.Y + j; if (GetGround(worldX, worldY) == GroundTileType.Undefined || GetGround(worldX, worldY) == GroundTileType.Grass || GetGround(worldX, worldY) == GroundTileType.Ground) { switch (area.GetTileType(i, j)) { case AreaTileType.Depth: break; case AreaTileType.Ground: if (GetGround(worldX, worldY) == GroundTileType.Undefined) { SetGround(worldX, worldY, GroundTileType.Sea); } else { Beach(worldX, worldY, 10); } break; case AreaTileType.Wall: SetGround(worldX, worldY, GroundTileType.Ground); break; default: break; } } } } }
private void Land(int x, int y, int size) { AreaGen area = new AreaGen(); area.MazeGen(size, 5, false, 1, 1, 0.5, 1); for (int i = 0; i < area.Width; i++) { for (int j = 0; j < area.Height; j++) { int worldX = x - area.Center.X + i; int worldY = y - area.Center.Y + j; if (GetGround(worldX, worldY) == GroundTileType.Undefined) { switch (area.GetTileType(i, j)) { case AreaTileType.Depth: break; case AreaTileType.Ground: SetGround(worldX, worldY, GroundTileType.Ground); break; case AreaTileType.Wall: SetTile(worldX, worldY, GroundTileType.Ground, ObjectTileType.Rock); break; default: break; } } } } }
private void Meadow(int x, int y, int size) { AreaGen area = new AreaGen(); area.MazeGen(size, 5, false, 1, 1, 0.3, 1); for (int i = 0; i < area.Width; i++) { for (int j = 0; j < area.Height; j++) { int worldX = x - area.Center.X + i; int worldY = y - area.Center.Y + j; if (GetGround(worldX, worldY) == GroundTileType.Undefined) { switch (area.GetTileType(i, j)) { case AreaTileType.Depth: break; case AreaTileType.Ground: SetGround(worldX, worldY, GroundTileType.Grass); break; case AreaTileType.Wall: SetTile(worldX, worldY, GroundTileType.Grass, ObjectTileType.Bush); break; default: break; } if (hasAdjTileOfType(worldX, worldY, GroundTileType.Ground)) { SetObject(worldX, worldY, ObjectTileType.Tree); } } } } }
private void Forest(int x, int y, int size) { AreaGen area = new AreaGen(); area.MazeGen(size, 10, false, 3, 0.1, 0, 0.4); for (int i = 0; i < area.Width; i++) { for (int j = 0; j < area.Height; j++) { switch (area.GetTileType(i, j)) { case AreaTileType.Depth: break; case AreaTileType.Ground: SetGround(x - area.Center.X + i, y - area.Center.Y + j, GroundTileType.Grass); break; case AreaTileType.Wall: SetTile(x - area.Center.X + i, y - area.Center.Y + j, GroundTileType.Grass, ObjectTileType.Tree); break; default: break; } } } }