-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameConstants.hs
86 lines (42 loc) · 1.05 KB
/
GameConstants.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{-
File : GameConstants.hs
Copyright : (c) Matt Teichman, 3/15/17
Constants for use in intializing the game state in Galaga.hs,
and for controlling the speed of the sprites.
-}
module GameConstants where
import Graphics.Gloss
type Size = (Int,Int)
screenSize :: Size
screenSize = (scrWidth, scrHeight)
-- frames per second
fps :: Int
fps = 60
-- width of the window
scrWidth :: Int
scrWidth = 800
-- height of the window
scrHeight :: Int
scrHeight = 600
-- room sprites have to go offscreen before they're considered
-- out of bounds
pad :: Float
pad = 50.0
-- player's speed
plyrSpeed :: Float
plyrSpeed = 450.0
-- speed of the enemies
eSpeed :: Float
eSpeed = 200.0
-- speed of the player's bullets
pbSpeed :: Float
pbSpeed = 1200.0
-- how often enemies attack in seconds
attackInterval :: Float
attackInterval = 3.0
-- how often the level changes
levelInterval :: Float
levelInterval = 30.0
-- how close two sprites have to be in order to count as colliding
collThreshold :: Float
collThreshold = 17.0