Fix start new game bug
This commit is contained in:
+16
-16
@@ -1,7 +1,5 @@
|
|||||||
module Dodge.Menu
|
module Dodge.Menu
|
||||||
( scodeToChar
|
( scodeToChar
|
||||||
, popScreen
|
|
||||||
, pushScreen
|
|
||||||
, pauseMenu
|
, pauseMenu
|
||||||
, gameOverMenu
|
, gameOverMenu
|
||||||
) where
|
) where
|
||||||
@@ -13,7 +11,7 @@ import Dodge.PreloadData
|
|||||||
import Dodge.Save
|
import Dodge.Save
|
||||||
import Dodge.Config.Update
|
import Dodge.Config.Update
|
||||||
import SDL
|
import SDL
|
||||||
import SDL.Internal.Numbered
|
--import SDL.Internal.Numbered
|
||||||
--import Preload.Update
|
--import Preload.Update
|
||||||
import Dodge.SoundLogic
|
import Dodge.SoundLogic
|
||||||
import Dodge.LevelGen
|
import Dodge.LevelGen
|
||||||
@@ -124,29 +122,29 @@ gameOverMenu = OptionScreen
|
|||||||
, _scOptionFlag = GameOverOptions
|
, _scOptionFlag = GameOverOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
--startNewGame' :: Universe -> IO (Maybe Universe)
|
||||||
|
--startNewGame' u = do
|
||||||
|
-- w <- generateWorldFromSeed i
|
||||||
|
-- return $ Just (u & uvWorld .~ w)
|
||||||
|
-- where
|
||||||
|
-- i = fst $ random (_randGen (_uvWorld u))
|
||||||
|
|
||||||
startNewGame :: Universe -> Maybe Universe
|
startNewGame :: Universe -> Maybe Universe
|
||||||
startNewGame w = Just $ w
|
startNewGame u = Just $ u
|
||||||
& menuLayers .~ [WaitScreen (const "GENERATING...") 1]
|
& menuLayers .~ [WaitScreen (const "GENERATING...") 1]
|
||||||
& uvWorld . sideEffects .~ \u -> do
|
& uvWorld . sideEffects .~ \_ -> do
|
||||||
w' <- generateWorldFromSeed i
|
w <- generateWorldFromSeed i
|
||||||
return (u & uvWorld .~ w')
|
return (u & menuLayers .~ [] & uvWorld .~ w)
|
||||||
where
|
where
|
||||||
i = fst $ random (_randGen (_uvWorld w))
|
i = fst $ random (_randGen (_uvWorld u))
|
||||||
|
|
||||||
-- | hacky
|
-- | hacky
|
||||||
scodeToChar :: Scancode -> Char
|
scodeToChar :: Scancode -> Char
|
||||||
scodeToChar = toEnum . (+ 61) . fromIntegral . toNumber
|
scodeToChar = toEnum . (+ 61) . fromIntegral . unwrapScancode
|
||||||
|
|
||||||
--charToScode :: Char -> Scancode
|
--charToScode :: Char -> Scancode
|
||||||
--charToScode = Scancode . fromIntegral . (\x -> x - 61) . fromEnum
|
--charToScode = Scancode . fromIntegral . (\x -> x - 61) . fromEnum
|
||||||
|
|
||||||
--levelMenu :: Int -> ScreenLayer
|
|
||||||
--levelMenu x = OptionScreen
|
|
||||||
-- { _scTitle = const $ "LEVEL "++ show x
|
|
||||||
-- , _scOptions = levelMenuOptions
|
|
||||||
-- , _scDefaultEff = unpause . storeLevel
|
|
||||||
-- , _scOptionFlag = NormalOptions
|
|
||||||
-- }
|
|
||||||
unpause :: Universe -> Maybe Universe
|
unpause :: Universe -> Maybe Universe
|
||||||
unpause w = Just . resumeSound $ w & menuLayers .~ []
|
unpause w = Just . resumeSound $ w & menuLayers .~ []
|
||||||
|
|
||||||
@@ -162,6 +160,8 @@ listControls =
|
|||||||
,("[space]" , "PICKUP ITEM" )
|
,("[space]" , "PICKUP ITEM" )
|
||||||
,("m" , "DISPLAY MAP" )
|
,("m" , "DISPLAY MAP" )
|
||||||
,("f" , "DROP ITEM" )
|
,("f" , "DROP ITEM" )
|
||||||
|
,("c" , "COMBINE ITEMS" )
|
||||||
|
,("x" , "TWEAK ITEMS" )
|
||||||
,("c[esc]" , "PAUSE" )
|
,("c[esc]" , "PAUSE" )
|
||||||
,("qe" , "ROTATE CAMERA")
|
,("qe" , "ROTATE CAMERA")
|
||||||
,("F5" , "QUICKSAVE")
|
,("F5" , "QUICKSAVE")
|
||||||
|
|||||||
Reference in New Issue
Block a user