Add view debug option
This commit is contained in:
@@ -26,25 +26,18 @@ import Dodge.LevelGen
|
||||
import Dodge.LevelGen.Data
|
||||
import Dodge.LightSources.Fitting
|
||||
import Dodge.Creature
|
||||
--import Dodge.Default
|
||||
import Geometry
|
||||
import Geometry.Vector3D
|
||||
import Picture
|
||||
import Data.Tile
|
||||
|
||||
--import Data.List
|
||||
--import Data.Function (on)
|
||||
--import qualified Data.Tuple.Extra as Tup
|
||||
--import qualified Data.Map.Strict as M
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
import Control.Monad.State
|
||||
import System.Random
|
||||
{-
|
||||
A simple rectangular room with a light in the center.
|
||||
Creates links and pathfinding graph.
|
||||
-}
|
||||
{- A simple rectangular room with a light in the center.
|
||||
Creates links and pathfinding graph. -}
|
||||
roomRect
|
||||
:: Float -- ^ Width
|
||||
-> Float -- ^ Height
|
||||
@@ -73,9 +66,7 @@ roomRect x y xn yn = defaultRoom
|
||||
slnks = zip (translateS (V2 20 0) $ gridPoints xd (xn+1) 0 1 ) (repeat pi )
|
||||
lnks = nlnks ++ elnks ++ wlnks ++ slnks
|
||||
pth = linksAndPath lnks $ translateS (V2 20 20) (makeGrid xd xn yd yn)
|
||||
{-
|
||||
Creates a rectangular room, automatically creates links and pathfinding graph at a sensible size.
|
||||
-}
|
||||
{- Creates a rectangular room, automatically creates links and pathfinding graph at a sensible size. -}
|
||||
roomRectAutoLinks :: Float -> Float -> Room
|
||||
roomRectAutoLinks x y = roomRect x y ((ceiling x - 40) `div` 60) ((ceiling y - 40) `div` 60)
|
||||
|
||||
@@ -129,23 +120,12 @@ fourthWall w = do
|
||||
]
|
||||
]
|
||||
pure $ defaultRoom
|
||||
{ _rmPolys = [ map toV2 [(0,0),(w,w),(-w,w)] ]
|
||||
{ _rmPolys = [ [V2 0 0,V2 w w,V2 (-w) w] ]
|
||||
, _rmLinks = [(V2 0 w, 0)]
|
||||
, _rmPath = [(V2 0 w,V2 0 0),(V2 0 0,V2 0 w)]
|
||||
, _rmPS = b
|
||||
, _rmBound = [[V2 0 0,V2 w w,V2 (-w) w]]
|
||||
}
|
||||
--fourthCorner :: Float -> Room
|
||||
--fourthCorner w = Room
|
||||
-- { _rmPolys = [ [(0,0),(w,w),(0,2*w),(-w,w)] ]
|
||||
-- , _rmLinks =
|
||||
-- [((w/2,3*w/2), negate $ pi/4)
|
||||
-- ,((negate $ w/2,3*w/2), pi/4)
|
||||
-- ]
|
||||
-- , _rmPath = [((0,w),(0,0)),((0,0),(0,w))]
|
||||
-- , _rmPS = [sPS (0,w) 0 putLamp]
|
||||
-- , _rmBound = [[(w,w),(0,2*w),(-w,w)]]
|
||||
-- }
|
||||
|
||||
fourthCornerWall :: RandomGen g => Float -> State g Room
|
||||
fourthCornerWall w = do
|
||||
@@ -246,7 +226,7 @@ centerVaultRoom w h d = do
|
||||
]
|
||||
++ map (\a -> mountedLightV (rotateV a $ V2 0 d) (rotate3z a $ V3 0 (d+30) 70))
|
||||
[0,0.5*pi,pi,1.5*pi]
|
||||
++ concat (map (\r -> map (shiftPSBy (V2 0 0,r)) $ theDoor)
|
||||
++ concat (map (\r -> map (shiftPlacement (V2 0 0,r)) $ theDoor)
|
||||
[0,pi/2,pi,3*pi/2])
|
||||
, _rmBound = [rectNSWE h (-h) (-w) w]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user