Implement wall penetrating bullets
This commit is contained in:
@@ -35,7 +35,6 @@ updateBlocks w = (\w' -> seq (_wallsZone w') w') $ flip (foldr removeFromZone) d
|
||||
killBlock :: Wall -> World -> World
|
||||
killBlock bl w = f bl .
|
||||
flip (foldr unshadow)
|
||||
-- flip (foldr (\i -> set (walls . ix i . blVisible) (True)))
|
||||
(_blShadows bl)
|
||||
$ w
|
||||
where
|
||||
@@ -50,7 +49,8 @@ killBlock bl w = f bl .
|
||||
unshadow :: Int -> World -> World
|
||||
unshadow bid w = case w ^? walls . ix bid of
|
||||
Just b -> let (x,y) = zoneOfPoint $ pHalf (_wlLine b !! 0) (_wlLine b !! 1)
|
||||
in w & wallsZone . ix x . ix y . ix bid . blVisible %~ \_ -> True
|
||||
in w & wallsZone . ix x . ix y . ix bid . blVisible %~ (\_ -> True)
|
||||
& walls . ix bid . blVisible %~ \_ -> True
|
||||
Nothing -> w
|
||||
|
||||
degradeBlock :: Wall -> World -> World
|
||||
|
||||
Reference in New Issue
Block a user