Add indexed world modifications, example use in flicker lights

This commit is contained in:
2021-11-17 11:24:40 +00:00
parent 559d7e3a23
commit 9db091597d
10 changed files with 110 additions and 32 deletions
+6
View File
@@ -58,6 +58,7 @@ functionalUpdate w = case _menuLayers w of
. updateDoors
. resetWorldEvents
. dbArg _worldEvents
. updateModifications
. updateParticles
. updateProjectiles
. updateLightSources
@@ -82,6 +83,11 @@ functionalUpdate w = case _menuLayers w of
where
(x,y) = cloudZoneOfPoint $ stripZ $ _clPos cl
updateModifications :: World -> World
updateModifications w = foldr f w (_modifications w)
where
f md = _mdUpdate md md
splinterBlock :: Block -> World -> World
splinterBlock bl w = foldr unshadowBlock w (_blShadows bl) -- foldr shiftTowardCen w (_blWallIDs bl)
& blocks . ix (_blID bl) . blHPs %~ tail