Refactoring, add screen when generating level

This commit is contained in:
2021-05-03 14:44:27 +02:00
parent 2bf23db935
commit 6e6757499c
19 changed files with 342 additions and 118 deletions
+7 -4
View File
@@ -65,10 +65,13 @@ handlePressedKeyInMenu mState scode w = case mState of
pushMenu ml w = Just $ w & menuLayers %~ (ml :)
popMenu w = Just $ w & menuLayers %~ tail
sw = w & sideEffects %~ (setVol (_config w) : )
startNewGame = Just $ updateFramebufferSize $ generateFromList levx
$ initialWorld
& randGen .~ _randGen w
& config .~ _config w
startNewGame = Just $ w
& menuLayers .~ [WaitMessage "GENERATING..." 1]
& worldEvents .~ const aNewGame
aNewGame :: World
aNewGame = updateFramebufferSize $ generateFromList levx $ initialWorld
& randGen .~ _randGen w
& config .~ _config w
updateFramebufferSize :: World -> World
updateFramebufferSize w = w & sideEffects