Work on saving/loading concurrently
This commit is contained in:
+19
-16
@@ -63,21 +63,24 @@ import Sound.Data
|
||||
|
||||
{- For most menus the only way to change the world is using event handling. -}
|
||||
updateUniverse :: Universe -> Universe
|
||||
updateUniverse u = (uvConcEffects .~ Nothing) $ case _menuLayers u of
|
||||
(WaitScreen s i : _)
|
||||
| i < 1 -> u & over uvWorld doWorldEvents
|
||||
| otherwise -> u & menuLayers %~ ((WaitScreen s (i -1) :) . tail)
|
||||
(OptionScreen{_scOptionFlag = GameOverOptions} : _) ->
|
||||
u & uvWorld
|
||||
%~ (
|
||||
--updateParticles
|
||||
(cWorld . radarBlips .~ [])
|
||||
-- . updateIMl _props _pjUpdate
|
||||
. updateLightSources
|
||||
. updateClouds
|
||||
)
|
||||
(_ : _) -> u
|
||||
[] -> functionalUpdate u
|
||||
updateUniverse u
|
||||
| isblocking = u
|
||||
| otherwise = case _uvScreenLayers u of
|
||||
(OptionScreen{_scOptionFlag = GameOverOptions} : _) ->
|
||||
u & uvWorld
|
||||
%~ (
|
||||
--updateParticles
|
||||
(cWorld . radarBlips .~ [])
|
||||
-- . updateIMl _props _pjUpdate
|
||||
. updateLightSources
|
||||
. updateClouds
|
||||
)
|
||||
(_ : _) -> u
|
||||
[] -> functionalUpdate u
|
||||
where
|
||||
isblocking = case u ^. uvConcEffects of
|
||||
BlockingConcEffect{} -> True
|
||||
_ -> False
|
||||
|
||||
-- | The update step.
|
||||
functionalUpdate :: Universe -> Universe
|
||||
@@ -444,7 +447,7 @@ checkEndGame :: Universe -> Universe
|
||||
checkEndGame uv = case _deathDelay (_cWorld w) of
|
||||
Just x
|
||||
| x < 0 ->
|
||||
uv & menuLayers .~ [gameOverMenu]
|
||||
uv & uvScreenLayers .~ [gameOverMenu]
|
||||
& uvWorld . cWorld . deathDelay .~ Nothing
|
||||
Just _ -> uv & uvWorld . cWorld . deathDelay . _Just -~ 1
|
||||
_ | _crHP (you w) < 1 -> uv & uvWorld . cWorld . deathDelay ?~ 50
|
||||
|
||||
Reference in New Issue
Block a user