Move flame into its own datatype
This commit is contained in:
+8
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user