-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainMenu.hs
64 lines (45 loc) · 1.47 KB
/
MainMenu.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{-
File : MainMenu.hs
Copyright : (c) Matt Teichman, 3/15/17
Module for handling the main menu in Galaga.hs.
-}
module MainMenu where
import Graphics.Gloss
import Graphics.Gloss.Data.Picture
import Sprite
-- displays a message: "Main Menu"
mmMessage :: IO Picture
mmMessage
= return $ color white
$ translate (-300) (0)
$ scale 0.25 0.25
$ text ("Main Menu")
-- displays a message: "press 's' to start"
mmS :: IO Picture
mmS
= return $ color white
$ translate (-300) (-100)
$ scale 0.25 0.25
$ text ("press 's' to start")
-- displays a message: "press 'q' to quit"
mmQ :: IO Picture
mmQ
= return $ color white
$ translate (-300) (-150)
$ scale 0.25 0.25
$ text ("press 'q' to quit")
-- displays a message: "press 'h' to view the high scores"
mmH :: IO Picture
mmH
= return $ color white
$ translate (-300) (-200)
$ scale 0.25 0.25
$ text ("press 'h' to view the high scores")
resizeLogo :: (Float, Float) -> (Float, Float) -> IO Picture
resizeLogo scaleXY transXY = do
pic <- galPic
return $ ((scale (fst scaleXY) (snd scaleXY)) .
(translate (fst transXY) (snd transXY)))
pic
galPic :: IO Picture
galPic = loadBMP "images/models/galaga.bmp"