Make chasms remove RoomPos within their boundaries

This commit is contained in:
2025-10-07 10:43:15 +01:00
parent 4cc5477f07
commit e9178f9643
12 changed files with 280 additions and 256 deletions
+3
View File
@@ -25,6 +25,7 @@ roomNgon n x = do
, _rmBound = [poly]
, _rmFloor = Tiled [makeTileFromPoly poly 2]
, _rmName = show n ++ "gon"
, _rmPos = poss
}
where
rot = 2 * pi / fromIntegral n
@@ -34,6 +35,8 @@ roomNgon n x = do
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)]
lnks =
sortOn ((\(V2 a b) -> (negate b, a)) . fst . snd)