Put controls on separate menu screen
This commit is contained in:
@@ -14,7 +14,6 @@ menuScreen w = case _menuLayers w of
|
||||
(LevelMenu x:_) -> pictures
|
||||
[color (withAlpha 0.5 black) $ polygon $ screenBox w
|
||||
,tst (-100) 100 0.4 ("LEVEL "++show x)
|
||||
,controlsList
|
||||
]
|
||||
(PauseMenu:_) -> pictures
|
||||
[color (withAlpha 0.5 black) $ polygon $ screenBox w
|
||||
@@ -22,7 +21,7 @@ menuScreen w = case _menuLayers w of
|
||||
,tst (-100) 50 0.2 "n - new level"
|
||||
,tst (-100) 0 0.2 "r - restart"
|
||||
,tst (-100) (-50) 0.2 "o - options"
|
||||
, controlsList
|
||||
,tst (-100) (-100) 0.2 "c - controls"
|
||||
]
|
||||
(GameOverMenu:_) -> pictures
|
||||
[color (withAlpha 0.5 black) $ polygon $ screenBox w
|
||||
@@ -30,7 +29,7 @@ menuScreen w = case _menuLayers w of
|
||||
,tst (-100) 50 0.2 "n - new level"
|
||||
,tst (-100) 0 0.2 "r - restart"
|
||||
,tst (-100) (-50) 0.2 "o - options"
|
||||
,controlsList
|
||||
,tst (-100) (-100) 0.2 "c - controls"
|
||||
]
|
||||
(OptionMenu : _) -> pictures
|
||||
[color (withAlpha 0.5 black) $ polygon $ screenBox w
|
||||
@@ -38,8 +37,19 @@ menuScreen w = case _menuLayers w of
|
||||
,tst (-180) 50 0.2 $ "y - master volume + u : " ++ mavol
|
||||
,tst (-180) 0 0.2 $ "h - sound volume + j : " ++ snvol
|
||||
,tst (-180) (-50) 0.2 $ "n - music volume + m : " ++ muvol
|
||||
]
|
||||
(ControlList : _) -> pictures
|
||||
[color (withAlpha 0.5 black) $ polygon $ screenBox w
|
||||
,tst (-100) 100 0.4 "CONTROLS"
|
||||
,controlsList
|
||||
]
|
||||
(ConfigSaveScreen : _) -> pictures
|
||||
[color (withAlpha 0.5 black) $ polygon $ screenBox w
|
||||
,tst (-100) 100 0.4 "OPTIONS"
|
||||
,tst (-180) 50 0.2 $ "y - master volume + u : " ++ mavol
|
||||
,tst (-180) 0 0.2 $ "h - sound volume + j : " ++ snvol
|
||||
,tst (-180) (-50) 0.2 $ "n - music volume + m : " ++ muvol
|
||||
]
|
||||
_ -> blank
|
||||
where
|
||||
tst x y sc t = translate x y $ scale sc sc $ color white $ text t
|
||||
@@ -48,25 +58,23 @@ menuScreen w = case _menuLayers w of
|
||||
muvol = f $ _volume_music $ _config w
|
||||
f x = show $ round $ 10 * x
|
||||
|
||||
controlsList = pictures [tst (-250) (-130) 0.15 "controls:"
|
||||
,tst (-150) (-130) 0.15 "wasd"
|
||||
,tst 0 (-130) 0.15 "movement"
|
||||
,tst (-150) (-160) 0.15 "[rmb]"
|
||||
,tst 0 (-160) 0.15 "aim"
|
||||
,tst (-150) (-190) 0.15 "[rmb+lmb]"
|
||||
,tst 0 (-190) 0.15 "shoot or use item"
|
||||
,tst (-150) (-220) 0.15 "[wheelscroll]"
|
||||
,tst 0 (-220) 0.15 "select item"
|
||||
,tst (-150) (-250) 0.15 "[space]"
|
||||
,tst 0 (-250) 0.15 "pickup item"
|
||||
,tst (-150) (-280) 0.15 "f"
|
||||
,tst 0 (-280) 0.15 "drop item"
|
||||
,tst (-150) (-310) 0.15 "cp[esc]"
|
||||
,tst 0 (-310) 0.15 "pause"
|
||||
,tst (-150) (-340) 0.15 "qe[lmb]"
|
||||
,tst 0 (-340) 0.15 "rotate camera"
|
||||
]
|
||||
where tst x y sc t = translate x y $ scale sc sc $ color white $ text t
|
||||
controlsList = pictures $ concat $ zipWith butAndEff
|
||||
[("wasd", "movement")
|
||||
,("[rmb]", "aim")
|
||||
,("[rmb+lmb]", "shoot or use item")
|
||||
,("[wheelscroll]" , "select item" )
|
||||
,("[space]" , "pickup item" )
|
||||
,("m" , "display map" )
|
||||
,("f" , "drop item" )
|
||||
,("c[esc]" , "pause" )
|
||||
,("qe" , "rotate camera")
|
||||
]
|
||||
[60,30..]
|
||||
where
|
||||
butAndEff (btext,etext) y =
|
||||
[translate (-250) y $ scale 0.15 0.15 $ color white $ text btext
|
||||
,translate 0 y $ scale 0.15 0.15 $ color white $ text etext
|
||||
]
|
||||
|
||||
screenBox w = [ (halfWidth w, halfHeight w)
|
||||
, (-halfWidth w, halfHeight w)
|
||||
|
||||
Reference in New Issue
Block a user