Add missing file, workaround for placement positions bug

This commit is contained in:
2022-03-08 07:59:36 +00:00
parent 79b5241c32
commit 59e6f433ff
16 changed files with 67 additions and 86 deletions
+7 -13
View File
@@ -53,25 +53,19 @@ litCorridor90 = do
}
-- | A random length corridor with a destructible block blocking it.
longBlockedCorridor :: RandomGen g => State g (SubCompTree Room)
longBlockedCorridor = do
longBlockedCorridor :: RandomGen g => Int -> State g (SubCompTree Room)
longBlockedCorridor maxn = do
r <- state $ randomR (0,pi)
n <- state $ randomR (0,3)
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 <$> randomiseOutLinks corridor)
,sPS (V2 20 15) 0 putLamp
]
sequence $ treeFromPost (replicate n $ PassDown <$> 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 = do
r <- state $ randomR (0,pi)
let plmnts =
[sPS (V2 20 40) r $ dirtPoly $ square 10
,spanLightI (V2 0 15) (V2 40 15)
]
sequence $ treeFromPost [] $ return $ UseAll $ set rmPmnts plmnts corridor
blockedCorridor = longBlockedCorridor 0
dirtPoly :: [Point2] -> PSType
dirtPoly = PutBlock DirtBlock 1 [] dirtWall . reverse