Work on connecting pathfinding grid

This commit is contained in:
2022-07-09 12:36:17 +01:00
parent 9c352e4a83
commit fb66a45495
11 changed files with 16 additions and 32 deletions
+2 -7
View File
@@ -20,7 +20,8 @@ corridor :: Room
corridor = defaultRoom
{ _rmPolys = [poly]
, _rmLinks = lnks'
, _rmPath = foldMap (doublePairSet . (,) (V2 20 60) . fst) lnks
--, _rmPath = foldMap (doublePairSet . (,) (V2 20 60) . fst) lnks
, _rmPath = foldMap (doublePairSet . (,) (V2 20 60)) [V2 20 70,V2 20 10]
, _rmPmnts = [ spanLightI (V2 0 39.5) (V2 40 39.5) ]
, _rmBound = [ rectNSWE 50 30 (-5) 45 ]
, _rmFloor = Tiled [makeTileFromPoly poly 2]
@@ -35,12 +36,6 @@ corridor = defaultRoom
,uncurry outLink (V2 20 70 , negate $ pi/6)
,uncurry inLink (V2 20 10 , pi)
]
lnks =
[ (V2 20 70, 0::Float)
, (V2 20 70, pi/6)
, (V2 20 70, negate $ pi/6)
, (V2 20 10, pi)
]
keyholeCorridor :: Room
keyholeCorridor = corridor
{ _rmPath = mempty
+1 -1
View File
@@ -17,7 +17,7 @@ import Control.Lens
door :: Room
door = defaultRoom
{ _rmPolys = [rectNSWE 40 0 0 40]
, _rmLinks = init lnks ++ [last lnks]
, _rmLinks = lnks
, _rmPath = doublePairSet (V2 20 35,V2 20 5)
-- door extends into side walls (for shadows as rendered 12/03)
, _rmPmnts = [putAutoDoor (V2 0 20) (V2 40 20)]
+4 -2
View File
@@ -325,5 +325,7 @@ spawnerRoom = do
corDoor :: State StdGen (MetaTree Room String)
corDoor = do
cor <- shuffleLinks $ cleatOnward corridor
return $ tToBTree "corDoor" $ treePost [door,cor]
--cor <- shuffleLinks $ cleatOnward corridor
--return $ tToBTree "corDoor" $ treePost [door,cor]
cor <- shuffleLinks corridor
return $ tToBTree "corDoor" $ treePost [door,cor,cleatOnward door]