Add random generator update when creature does random turn

This commit is contained in:
2022-04-07 23:17:16 +01:00
parent 100f776ddd
commit a6fdd66b9b
4 changed files with 101 additions and 7 deletions
+6
View File
@@ -18,6 +18,7 @@ import Sound.Data
import Geometry
import LensHelp
--import System.Random
import Data.List
import Data.Maybe
--import Data.Function
@@ -45,6 +46,7 @@ updateUniverse u = case _menuLayers u of
{- | The update step. -}
functionalUpdate :: Configuration -> World -> World
functionalUpdate cfig w = checkEndGame
-- . updateRandGen
. (worldClock +~ 1)
. doRewind
. updateDistortions
@@ -83,6 +85,10 @@ functionalUpdate cfig w = checkEndGame
where
(x,y) = cloudZoneOfPoint $ stripZ $ _clPos cl
-- hack
--updateRandGen :: World -> World
--updateRandGen = randGen %~ (snd . (uniform :: StdGen -> (Int,StdGen)))
doRewind :: World -> World
doRewind w = case _maybeWorld w of
Just' w' -> w' & timeFlow .~ RewindingLastFrame