Locate bug in wall zoning

This commit is contained in:
2021-09-11 00:47:52 +01:00
parent c695767fb0
commit 7c62ef4d48
5 changed files with 84 additions and 55 deletions
+12 -12
View File
@@ -52,26 +52,26 @@ rectanglePairs wdth a b =
norm = wdth *.* normalizeV ( vNormal (b -.- a))
mkSingleDoor :: Color -> Bool -> (World -> Bool) -> Point2 -> Point2 -> Float -> [Int] -> [Wall]
mkSingleDoor c isPathable cond hingep hw speed is
= addSoundToDoor (head is) pld hwd
mkSingleDoor c isPathable cond hingep edgep speed is
= addSoundToDoor (head is) (fst $ head theDoor) (fst $ head shiftedDoor)
$ zipWith3 (linearPane c isPathable cond speed)
is
theDoor
(map (bimap shiftLeft shiftLeft) theDoor)
shiftedDoor
where
theDoor = rectanglePairs 9 hingep hw
shiftLeft = (+.+ (hingep -.- hw))
norm = 9 *.* normalizeV ( vNormal (hw -.- hingep))
pld = hingep -.- norm
hwd = hw -.- norm
theDoor = rectanglePairs 9 hingep edgep
shiftedDoor = map (bimap shiftLeft shiftLeft) theDoor
shiftLeft = (+.+ (hingep -.- edgep))
mkDoubleDoor :: Color -> Bool -> (World -> Bool) -> Point2 -> Point2 -> Float -> [Int] -> [Wall]
mkDoubleDoor c isPathable cond pl pr speed is
= addSoundToDoor (head is) pld hwd $ zipWith3 (linearPane c isPathable cond speed)
is
(leftDoor ++ rightDoor)
(map shiftLeft leftDoor ++ map shiftRight rightDoor)
= addSoundToDoor (head is) (fst $ head leftDoor) (fst $ head shiftedDoor)
$ zipWith3 (linearPane c isPathable cond speed)
is
(leftDoor ++ rightDoor)
shiftedDoor
where
shiftedDoor = map shiftLeft leftDoor ++ map shiftRight rightDoor
leftDoor =
[ (pld +.+ perp,hwd)
, (hwd, hwu)