Move flame into its own datatype

This commit is contained in:
2022-07-18 22:41:40 +01:00
parent c14b3ff787
commit 54ba0fbedc
29 changed files with 444 additions and 318 deletions
+8 -1
View File
@@ -6,6 +6,7 @@ Description : Simulation update
module Dodge.Update ( updateUniverse ) where
import Dodge.Data
import Dodge.Spark
import Dodge.Flame
import Dodge.Bullet
import Dodge.Update.Cloud
import Dodge.Machine.Update
@@ -83,6 +84,7 @@ functionalUpdate cfig w = checkEndGame
. dbArg _worldEvents
. updateIMl _modifications _mdUpdate
. updateSparks
. updateFlames
. updateParticles
. updateBullets
. updateRadarBlips
@@ -222,10 +224,15 @@ updateBullets w = updateInstantBullets $ set bullets (catMaybes ps) w'
where
(w',ps) = mapAccumR updateBullet w $ _bullets w
updateFlames :: World -> World
updateFlames w = w' & flames .~ catMaybes newflames
where
(w',newflames) = mapAccumR moveFlame w $ _flames w
updateSparks :: World -> World
updateSparks w = w' & sparks .~ catMaybes newsparks
where
(w',newsparks) = mapAccumR (\a b -> moveSpark a b) w $ _sparks w
(w',newsparks) = mapAccumR moveSpark w $ _sparks w
{- Apply internal particle updates, delete 'Nothing's. -}
updateParticles :: World -> World