Locate bug in wall zoning
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user