diff options
author | Griffin Smith <root@gws.fyi> | 2019-09-13T19·24-0400 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2019-09-13T19·24-0400 |
commit | c06edf3cc698f36e995719dc6e192c5663110f6d (patch) | |
tree | dd7872fbad6dc4b0e04f943ef63a64c3e002479b /src/Xanthous/Generators/CaveAutomata.hs | |
parent | 9ebdc6fbb446fea5e505172a6b3dd459beaf3552 (diff) |
Place the chacracter in the level at startup time
Randomly select a position in the largest contiguous region of the generated level in which to place the character at startup time.
Diffstat (limited to 'src/Xanthous/Generators/CaveAutomata.hs')
-rw-r--r-- | src/Xanthous/Generators/CaveAutomata.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Xanthous/Generators/CaveAutomata.hs b/src/Xanthous/Generators/CaveAutomata.hs index bf37cb3f08e7..a2f0a165e3c1 100644 --- a/src/Xanthous/Generators/CaveAutomata.hs +++ b/src/Xanthous/Generators/CaveAutomata.hs @@ -92,7 +92,7 @@ generate params dims gen $ flip runRandT gen $ generate' params dims -generate' :: RandomGen g => Params -> Dimensions -> CellM g s (Cells s) +generate' :: RandomGen g => Params -> Dimensions -> CellM g s (MCells s) generate' params dims = do cells <- randInitialize dims $ params ^. aliveStartChance let steps' = params ^. steps @@ -100,7 +100,7 @@ generate' params dims = do $ for_ [0 .. pred steps'] . const $ stepAutomata cells dims params pure cells -stepAutomata :: forall s g. Cells s -> Dimensions -> Params -> CellM g s () +stepAutomata :: forall s g. MCells s -> Dimensions -> Params -> CellM g s () stepAutomata cells dims params = do origCells <- lift $ cloneMArray @_ @(STUArray s) cells for_ (range ((0, 0), (dims ^. width, dims ^. height))) $ \pos -> do |