Control wall damage effects using the wall
This commit is contained in:
+3
-5
@@ -89,11 +89,10 @@ splinterBlock bl w = foldr unshadowBlock w (_blShadows bl) -- foldr shiftTowardC
|
||||
& blocks . ix (_blID bl) . blHPs %~ tail
|
||||
& theSoundEffect cen
|
||||
where
|
||||
wls = map (_walls w IM.!) (IS.toList $ _blWallIDs bl)
|
||||
ps = map (fst . _wlLine) wls
|
||||
cen = centroid ps
|
||||
wls = IM.restrictKeys (_walls w) (_blWallIDs bl)
|
||||
cen = centroid $ fmap (fst . _wlLine) wls
|
||||
theSoundEffect
|
||||
| _wlOpacity (head wls) == SeeThrough = mkSoundSplinterGlass
|
||||
| _wlOpacity (snd $ IM.findMin wls) == SeeThrough = mkSoundSplinterGlass
|
||||
| otherwise = mkSoundSplinterBlock
|
||||
|
||||
unshadowBlock :: Int -> World -> World
|
||||
@@ -121,7 +120,6 @@ destroyBlock bl w = w
|
||||
where
|
||||
wlids = _blWallIDs bl
|
||||
pos = fst . _wlLine $ _walls w IM.! IS.findMin wlids
|
||||
|
||||
-- | Note the explict use of record syntax. Using lens created a space leak.
|
||||
resetWorldEvents :: World -> World
|
||||
resetWorldEvents w = w {_worldEvents = id}
|
||||
|
||||
Reference in New Issue
Block a user