Allow for random composition of trees

This commit is contained in:
2022-06-09 11:24:13 +01:00
parent 1f05c74abc
commit 1789a3785d
17 changed files with 103 additions and 88 deletions
+2 -3
View File
@@ -14,15 +14,14 @@ import Dodge.Tree
import Control.Monad.State
import System.Random
import Data.Tree
branchRectWith :: RandomGen g => State g (SubCompTree Room) -> State g (SubCompTree Room)
branchRectWith t = do
x <- state $ randomR (100,200)
y <- state $ randomR (100,200)
b <- t
root <- shuffleLinks $ roomRectAutoLinks x y
return $ Node (PassDown root)
rt <- shuffleLinks $ roomRectAutoLinks x y
return $ Node (PassDown rt)
[ Node (UseAll door) []
, changeToPassDown <$> treeFromTrunk [PassDown door] b
]