Make all items have an id an associated location

This commit is contained in:
2022-08-01 23:50:26 +01:00
parent 237cd3e020
commit 82aedc3830
11 changed files with 123 additions and 84 deletions
+3
View File
@@ -4,6 +4,7 @@ module Dodge.Layout (
) where
import qualified Control.Foldl as L
import Dodge.Item.Location.Initialize
import Control.Lens
import Data.Foldable
import Data.Function
@@ -34,6 +35,7 @@ generateLevelFromRoomList gr' w =
over gwWorld initWallZoning
. over gwWorld randomCompass
. over gwWorld setupWorldBounds
. over (gwWorld . cWorld) initItemLocations
. doAfterPlacements
. doInPlacements
. doOutPlacements
@@ -52,6 +54,7 @@ generateLevelFromRoomList gr' w =
rs = map doRoomShift $ IM.elems rs'
rs' = mapM shuffleRoomPos gr' & evalState $ _randGen w
randomCompass :: World -> World
randomCompass w = w & cWorld . cameraRot .~ (takeOne [0, 0.5 * pi, pi, 1.5 * pi] & evalState $ _randGen w)