Fixed rooms being created where they would collide with an unavailable point on the map.
This commit is contained in:
parent
d091a7f745
commit
5f2be1333b
3 changed files with 36 additions and 31 deletions
|
|
@ -29,14 +29,13 @@ namespace DungeonGenerator
|
|||
|
||||
EvenDisperser disperser = new EvenDisperser(_xLength, _yLength, _entrancePoints); //TODO calculate L and W from length
|
||||
int numberOfMonsterRooms = 7; // TODO: Calculate from ratio
|
||||
|
||||
for (var i = 0; i < numberOfMonsterRooms; i ++)
|
||||
{
|
||||
Point newSpot = disperser.GetPoint(SIDE_LENGTH_OF_MONSTER, SIDE_LENGTH_OF_MONSTER);
|
||||
_monsterRooms.Add(new Room(
|
||||
RoomType.Monster,
|
||||
_monsterRooms.Add(disperser.GenerateAndPlaceRoom(
|
||||
SIDE_LENGTH_OF_MONSTER,
|
||||
SIDE_LENGTH_OF_MONSTER,
|
||||
SIDE_LENGTH_OF_MONSTER,
|
||||
newSpot));
|
||||
RoomType.Monster));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue