-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
51 lines (44 loc) · 1.12 KB
/
settings.py
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
import pygame, os
blue = (0, 0, 128)
black = (0,0,0)
white = (255,255,255)
shadow = (192, 192, 192)
white = (255, 255, 255)
lightGreen = (0, 255, 0)
green = (0, 200, 0)
darkGreen = (0, 100, 0)
yellow = (255,255,0)
blue = (0, 0, 128)
grey = (169, 169, 169)
lightBlue = (0, 0, 255)
cyan = (50, 255, 255)
red = (200, 0, 0)
lightRed = (255, 100, 100)
purple = (102, 0, 102)
orangeRed = (255,69,0)
keySet = {'stop': pygame.K_SPACE, 'retry': pygame.K_SPACE}
def checkKey(move):
keys = pygame.key.get_pressed()
if isinstance(move, str):
try:
for k in keySet[move]:
if keys[k]:
return True
except TypeError:
if keys[keySet[move]]:
return True
return False
winWidth, winHeight = 500, 600
FPS = 60
delta = 1/FPS
deltaConst = delta/(1/60)
# ASSETSPATH =
# def asset(assetName):
# global ASSETSPATH
# return os.path.join(ASSETSPATH, assetName)
if not __name__ == '__main__':
pygame.font.init()
fonts = {
'gameover':pygame.font.SysFont('Comic Sans MS', 23),
'score': pygame.font.SysFont('Comic Sans MS', 23)
}