Commit before reorganising level generation
This commit is contained in:
+23
-2
@@ -19,11 +19,32 @@ import System.Random
|
||||
--import qualified Data.IntMap.Strict as IM
|
||||
|
||||
rezBox :: Room
|
||||
rezBox = shiftRoomBy (V2 (-20) (-10),0) $ roomRect 40 20 1 1
|
||||
& rmPmnts .~ [ spanColLightI (V3 0 0.7 0.2) 70 (V2 0 10) (V2 40 10) ]
|
||||
--rezBox = shiftRoomBy (V2 (-20) (-10),0) $ roomRect 40 20 1 1
|
||||
rezBox = roomRect 40 40 1 1
|
||||
& rmPmnts .~ [ spanColLightI (V3 0 0.5 0) 95 (V2 0 1) (V2 40 1) ]
|
||||
|
||||
rezInvBox :: Room
|
||||
rezInvBox = roomRect 40 40 1 1
|
||||
& rmPmnts .~ [ spanColLightI (V3 0 0.5 0) 95 (V2 0 39) (V2 40 39) ]
|
||||
|
||||
startRoom :: RandomGen g => State g (Tree (Either Room Room))
|
||||
startRoom = do
|
||||
w <- state $ randomR (100,400)
|
||||
h <- state $ randomR (100,200)
|
||||
let bottomEdgeTest (V2 _ y,_) = y < 1
|
||||
centralRoom <- randomiseOutLinks =<< changeLinkTo bottomEdgeTest
|
||||
((roomRectAutoLinks w h) {_rmPmnts = []})
|
||||
let n = length $ filter bottomEdgeTest $ _rmLinks centralRoom
|
||||
centralRoom' <- changeLinkFrom bottomEdgeTest centralRoom
|
||||
return $ treeFromTrunk [Left rezBox
|
||||
, Left door
|
||||
]
|
||||
(Node (Left centralRoom') (replicate (n-1) dbox ++ [Node (Right door) []]))
|
||||
where
|
||||
dbox = treeFromPost [Left door] (Left rezInvBox)
|
||||
|
||||
startRoom' :: RandomGen g => State g (Tree (Either Room Room))
|
||||
startRoom' = do
|
||||
w <- state $ randomR (100,400)
|
||||
h <- state $ randomR (200,400)
|
||||
let plmnts =
|
||||
|
||||
Reference in New Issue
Block a user