Add tilemap floors to rooms
This commit is contained in:
+14
-7
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user