Add tilemap floors to rooms

This commit is contained in:
2021-06-15 14:56:32 +02:00
parent 73bd407c49
commit da631e3b37
31 changed files with 181 additions and 66 deletions
+14 -7
View File
@@ -12,6 +12,8 @@ import Dodge.LevelGen.Data
import Dodge.Room.Data
import Dodge.RandomHelp
import Geometry
import Geometry.Data
import Data.Tile
import System.Random
import Control.Monad.State
@@ -64,13 +66,18 @@ shiftRoomToLink l r
(p,a) = last $ _rmLinks r
shiftRoomBy :: (Point2,Float) -> Room -> Room
shiftRoomBy shift r =
over rmPolys (fmap (map (shiftPointBy shift)))
$ over rmLinks (fmap (shiftLinkBy shift))
$ over rmPath (map (shiftPathPointBy shift))
$ over rmPS (fmap (shiftPSBy shift))
$ over rmBound (fmap (map (shiftPointBy shift)))
r
shiftRoomBy shift r = r
& rmPolys %~ fmap (map (shiftPointBy shift))
& rmLinks %~ fmap (shiftLinkBy shift)
& rmPath %~ map (shiftPathPointBy shift)
& rmPS %~ fmap (shiftPSBy shift)
& rmBound %~ fmap (map (shiftPointBy shift))
& rmFloor %~ map
( (tilePoly %~ map (shiftPointBy shift))
. (tileCenter %~ shiftPointBy shift )
. (tileX %~ shiftPointBy shift )
. (tileY %~ shiftPointBy shift )
)
shiftLinkBy
:: (Point2,Float)