Improve debris

This commit is contained in:
2022-06-16 12:24:09 +01:00
parent fa762c7687
commit aa29e5ddf2
14 changed files with 75 additions and 50 deletions
+3 -3
View File
@@ -162,9 +162,9 @@ updateIMl' fim fup w = foldl' (flip fup) w (fim w)
updateBlocks :: World -> World
updateBlocks w = foldr f w $ _blocks w
where
f bl w' = case _blHPs bl of
(x:_:_) | x < 1 -> splinterBlock bl w'
[x] | x < 1 -> destroyBlock bl w'
f bl w' = case _blHP bl of
-- x | x < 1 -> splinterBlock bl w'
x | x < 1 -> destroyBlock bl w'
_ -> w'
-- | Note the explict use of record syntax. Using lens created a space leak.