Removed check of distance to stop organic room placement.

This commit is contained in:
Max 2025-02-20 15:28:24 +01:00
parent 57f6ee51e1
commit ff17bece91
6 changed files with 4 additions and 5 deletions

View file

@ -13,8 +13,8 @@ class Program
var generator = new DungeonGenerator(); var generator = new DungeonGenerator();
// Call the method you want to run // Call the method you want to run
int width = 40; int width = 30;
int height = 28; int height = 20;
DungeonMap map = generator.GenerateDungeon(width, height, 5); DungeonMap map = generator.GenerateDungeon(width, height, 5);
DungeonLockPopulator.PopulateLocksOfDungeon(map); DungeonLockPopulator.PopulateLocksOfDungeon(map);
List<Room> potentialLootRooms = new List<Room>(); List<Room> potentialLootRooms = new List<Room>();

View file

@ -25,7 +25,7 @@ namespace DungeonMapGenerator
Random random = new Random(); Random random = new Random();
DungeonMap dungeonMap = new DungeonMap(_xLength, _yLength); DungeonMap dungeonMap = new DungeonMap(_xLength, _yLength);
dungeonMap.AddRooms(GenerateEntranceRooms(_xLength, _yLength, random.Next(1,3))); dungeonMap.AddRooms(GenerateEntranceRooms(_xLength, _yLength, 2));
dungeonMap.AddRoom(GenerateOnlyBossRoom(_xLength, _yLength, WIDTH_OF_BOSS, HEIGHT_OF_BOSS)); dungeonMap.AddRoom(GenerateOnlyBossRoom(_xLength, _yLength, WIDTH_OF_BOSS, HEIGHT_OF_BOSS));
EvenDisperser disperser = new EvenDisperser(_xLength, _yLength, dungeonMap.GetUnoccupiedPoints()); //TODO calculate L and W from length EvenDisperser disperser = new EvenDisperser(_xLength, _yLength, dungeonMap.GetUnoccupiedPoints()); //TODO calculate L and W from length
@ -623,8 +623,7 @@ namespace DungeonMapGenerator
List<Point> path = GetPointsOnLine(startingRoom.GetCenterOfRoom(), targetRoom.GetCenterOfRoom()); List<Point> path = GetPointsOnLine(startingRoom.GetCenterOfRoom(), targetRoom.GetCenterOfRoom());
bool roomPlaced = true; bool roomPlaced = true;
while (currentRoom.GetCenterOfRoom().ManhattanDistance(targetRoom.GetCenterOfRoom()) >= while (roomPlaced)
GetRoomSizeByType(type) && roomPlaced)
{ {
Room newRoom; Room newRoom;
// Get sides of room to try and place new room // Get sides of room to try and place new room