Files
loop/src/Dodge/Room/Branch.hs
T
2026-01-23 09:59:18 +00:00

28 lines
680 B
Haskell

{-
Collections of rooms that branch into multiple paths.
-}
module Dodge.Room.Branch where
--import Control.Monad.State
import Control.Monad.Trans.State.Lazy
import Dodge.Cleat
import Dodge.Data.GenWorld
import Dodge.Room.Door
import Dodge.Room.Link
import Dodge.Room.Procedural
import Dodge.Tree
import System.Random
branchRectWith :: RandomGen g => State g (Tree Room) -> State g (Tree Room)
branchRectWith t = do
x <- state $ randomR (100, 200)
y <- state $ randomR (100, 200)
b <- t
rt <- shuffleLinks =<< roomRectAutoLinks x y
return $
Node
rt
[ pure $ cleatOnward door
, treeFromTrunk [door] b
]