Add forgotten files, many updates concerning turrets and shields
This commit is contained in:
+8
-4
@@ -33,9 +33,7 @@ import System.Random
|
||||
|
||||
update :: World -> World
|
||||
update = (frameClock +~ 1) . functionalUpdate
|
||||
|
||||
{- |
|
||||
The update step.
|
||||
{- | The update step.
|
||||
For most menus the only way to change the world is using event handling. -}
|
||||
functionalUpdate :: World -> World
|
||||
functionalUpdate w = case _menuLayers w of
|
||||
@@ -149,10 +147,16 @@ updateProjectiles w = IM.foldl' (flip $ dbArg _pjUpdate) w $ _props w
|
||||
|
||||
{- Apply internal particle updates, delete 'Nothing's. -}
|
||||
updateParticles :: World -> World
|
||||
updateParticles w = set particles (catMaybes ps) w'
|
||||
updateParticles w = updateInstantParticles $ set particles (catMaybes ps) w'
|
||||
where
|
||||
(w',ps) = mapAccumR (\a b -> _ptUpdate b a b) w $ _particles w
|
||||
|
||||
updateInstantParticles :: World -> World
|
||||
updateInstantParticles w = case _instantParticles w of
|
||||
[] -> w
|
||||
ps -> let (w',ps') = mapAccumR (\a b -> _ptUpdate b a b) (w {_instantParticles=[]}) ps
|
||||
in updateInstantParticles $ w' & particles %~ (catMaybes ps' ++)
|
||||
|
||||
updateMachines :: World -> World
|
||||
updateMachines w = foldr f w (_machines w)
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user