Commit mid add time scroll

This commit is contained in:
2022-10-24 10:44:23 +01:00
parent 21dc670c9f
commit 86a9ab7582
17 changed files with 62 additions and 55 deletions
+6 -6
View File
@@ -87,7 +87,7 @@ functionalUpdate w =
checkEndGame
-- . updateRandGen
. over uvWorld (mouseButtons . each .~ True) -- to determine if the mouse button is held
. over uvWorld (cWorld . cwTime . worldClock +~ 1)
. over uvWorld (cwTime . worldClock +~ 1)
. over uvWorld updateWorldSelect
. over uvWorld doRewind
-- . over uvWorld (hammers . each %~ moveHammerUp)
@@ -231,7 +231,7 @@ setOldPos cr =
--updateRandGen = randGen %~ (snd . (uniform :: StdGen -> (Int,StdGen)))
doRewind :: World -> World
doRewind w = case w ^. cWorld . cwTime . maybeWorld of
doRewind w = case w ^. cwTime . maybeWorld of
Just' cw ->
w & cWorld .~ cw
& timeFlow .~ RewindingLastFrame
@@ -457,13 +457,13 @@ markSeen :: Wall -> Wall
markSeen wl = wl{_wlSeen = True}
checkEndGame :: Universe -> Universe
checkEndGame uv = case w ^. cWorld . cwTime . deathDelay of
checkEndGame uv = case w ^. cwTime . deathDelay of
Just x
| x < 0 ->
uv & uvScreenLayers .~ [gameOverMenu]
& uvWorld . cWorld . cwTime . deathDelay .~ Nothing
Just _ -> uv & uvWorld . cWorld . cwTime . deathDelay . _Just -~ 1
_ | _crHP (you w) < 1 -> uv & uvWorld . cWorld . cwTime . deathDelay ?~ 50
& uvWorld . cwTime . deathDelay .~ Nothing
Just _ -> uv & uvWorld . cwTime . deathDelay . _Just -~ 1
_ | _crHP (you w) < 1 -> uv & uvWorld . cwTime . deathDelay ?~ 50
_ -> uv
where
w = _uvWorld uv