Commit mid big tree composing change

This commit is contained in:
2022-06-09 21:25:22 +01:00
parent 8fb80f9691
commit 3edc7a0a58
20 changed files with 263 additions and 248 deletions
+5 -4
View File
@@ -1,5 +1,6 @@
{- Connecting rooms designed with a pass-through technique in mind. -}
module Dodge.Room.RoadBlock where
import Dodge.UseAll
import Dodge.Data
import Dodge.RoomLink
import Geometry
@@ -50,18 +51,18 @@ litCorridor90 = do
}
-- | A random length corridor with a destructible block blocking it.
longBlockedCorridor :: RandomGen g => Int -> State g (SubCompTree Room)
longBlockedCorridor :: RandomGen g => Int -> State g (Tree Room)
longBlockedCorridor maxn = do
r <- state $ randomR (0,pi)
n <- state $ randomR (0,maxn)
let plmnts = [sPS (V2 20 40) r $ dirtPoly $ square 10
,sPS (V2 20 15) 0 putLamp
]
sequence $ treeFromPost (replicate n $ PassDown <$> shuffleLinks corridor)
$ return $ UseAll $ set rmPmnts plmnts corridor
sequence $ treeFromPost (replicate n $ shuffleLinks corridor)
$ return $ useAll $ set rmPmnts plmnts corridor
-- | A single corridor with a destructible block blocking it.
blockedCorridor :: RandomGen g => State g (SubCompTree Room)
blockedCorridor :: RandomGen g => State g (Tree Room)
blockedCorridor = longBlockedCorridor 0
dirtPoly :: [Point2] -> PSType