Try to simplify link code in roomRect

This commit is contained in:
2025-10-27 15:10:19 +00:00
parent c88fc1c729
commit 0946ee1310
9 changed files with 95 additions and 105 deletions
+1 -2
View File
@@ -20,7 +20,7 @@ roomNgon n x = do
defaultRoom
{ _rmPolys = [poly]
, _rmLinks = map f lnks
, _rmPath = linksGridToPath (map f lnks) path4
, _rmPath = linksDAGToPath (map f lnks) path3
, _rmPmnts = [thelight]
, _rmBound = [poly]
, _rmFloor = Tiled [makeTileFromPoly poly 2]
@@ -34,7 +34,6 @@ roomNgon n x = do
path1 = polyOrthDist n (x-10)
path2 = concat $ zipWith g path1 (tail path1 <> [head path1])
path3 = loopPairs path2 <> fmap (,V2 0 0) path2
path4 = concatMap doublePair path3
poss = map (\p -> RoomPos p 0 mempty (NotLink True) mempty)
(V2 0 0 : path1)
g z y = [z, 0.5 * (z + y)]