Move bullet trajectory into bullet update function
This commit is contained in:
+3
-2
@@ -5,6 +5,7 @@ Description : Simulation update
|
||||
-}
|
||||
module Dodge.Update ( updateUniverse ) where
|
||||
import Dodge.Data
|
||||
import Dodge.Bullet
|
||||
import Dodge.Update.Cloud
|
||||
import Dodge.Machine.Update
|
||||
import Dodge.RadarBlip
|
||||
@@ -217,7 +218,7 @@ updateFlares = flares %~ mapMaybe updateFlare
|
||||
updateBullets :: World -> World
|
||||
updateBullets w = updateInstantBullets $ set bullets (catMaybes ps) w'
|
||||
where
|
||||
(w',ps) = mapAccumR (\a b -> _buUpdate b a b) w $ _bullets w
|
||||
(w',ps) = mapAccumR (\a b -> updateBullet a b) w $ _bullets w
|
||||
|
||||
{- Apply internal particle updates, delete 'Nothing's. -}
|
||||
updateParticles :: World -> World
|
||||
@@ -297,7 +298,7 @@ intersectSegSegs' _ _ _ = Nothing
|
||||
updateInstantBullets :: World -> World
|
||||
updateInstantBullets w = case _instantBullets w of
|
||||
[] -> w
|
||||
ps -> let (w',ps') = mapAccumR (\a b -> _buUpdate b a b) (w {_instantBullets=[]}) ps
|
||||
ps -> let (w',ps') = mapAccumR (\a b -> updateBullet a b) (w {_instantBullets=[]}) ps
|
||||
in updateInstantBullets $ w' & bullets .++~ catMaybes ps'
|
||||
|
||||
updateInstantParticles :: World -> World
|
||||
|
||||
Reference in New Issue
Block a user