Working room generation with less shifting, should be more sensible

This commit is contained in:
2021-11-15 01:55:35 +00:00
parent 8356496a7f
commit e93fa10a97
7 changed files with 15 additions and 64 deletions
+3 -3
View File
@@ -33,7 +33,7 @@ generateLevelFromRoomList gr' w
. placeWires
. doPartialPlacements
. doExtendedPlacements
. flip (mapAccumR doRoomPlacements) rs
. flip (mapAccumR doRoomPlacements) rs'
$ w { _walls = wallsFromRooms rs
, _floorTiles = floorsFromRooms rs
, _gameRooms = gameRoomsFromRooms rs
@@ -43,9 +43,9 @@ generateLevelFromRoomList gr' w
where
path = pairsToGraph dist pairPath
pairPath = concatMap _rmPath rs
rs = zipWith addTile zs gr
zs = map fromIntegral $ randomRs (0,63::Int) $ _randGen w
gr = map doRoomShift gr'
rs = map doRoomShift rs'
rs' = zipWith addTile zs gr'
placeWires :: (World,[Room])-> World
placeWires (w,rms) = foldr placeRoomWires w rms