Fill the outer edges of generated levels

To avoid the character being able to go OOB.

This is something we had in the Rust version but I hadn't ported over yet
This commit is contained in:
Griffin Smith 2019-09-14 15:16:27 -04:00
parent 33c831d23d
commit 6678ac986c
2 changed files with 13 additions and 1 deletions

View file

@ -98,6 +98,7 @@ generate' params dims = do
let steps' = params ^. steps
when (steps' > 0)
$ for_ [0 .. pred steps'] . const $ stepAutomata cells dims params
lift $ fillOuterEdgesM cells
pure cells
stepAutomata :: forall s g. MCells s -> Dimensions -> Params -> CellM g s ()