Add objects based on walls, called machines
This commit is contained in:
+4
-3
@@ -90,8 +90,8 @@ splinterBlock bl w = foldr unshadowBlock w (_blShadows bl) -- foldr shiftTowardC
|
||||
ps = map (fst . _wlLine) wls
|
||||
cen = centroid ps
|
||||
theSoundEffect
|
||||
| _wlIsSeeThrough (head wls) = mkSoundSplinterGlass
|
||||
| otherwise = mkSoundSplinterBlock
|
||||
| _wlOpacity (head wls) == SeeThrough = mkSoundSplinterGlass
|
||||
| otherwise = mkSoundSplinterBlock
|
||||
|
||||
unshadowBlock :: Int -> World -> World
|
||||
unshadowBlock wlid w = case w ^? walls . ix wlid of
|
||||
@@ -298,7 +298,7 @@ rotateToOverlappingWall w = case theWall of
|
||||
{- Finds the visible walls from a point to another point. -}
|
||||
visibleWalls :: Point2 -> Point2 -> IM.IntMap Wall -> [Wall]
|
||||
visibleWalls p1 p2 ws
|
||||
= takeUntil _wlIsSeeThrough
|
||||
= takeUntil theTest
|
||||
. map snd
|
||||
. sortOn (dist p1 . fromJust . fst)
|
||||
. filter (isJust . fst)
|
||||
@@ -306,3 +306,4 @@ visibleWalls p1 p2 ws
|
||||
$ IM.elems ws
|
||||
where
|
||||
f wl = (uncurry intersectSegSeg (_wlLine wl) p1 p2, wl)
|
||||
theTest wl = _wlOpacity wl /= Opaque
|
||||
|
||||
Reference in New Issue
Block a user