-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.py
49 lines (42 loc) · 1.63 KB
/
constants.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
BACKGROUND_COLOR = (224, 215, 175)
BOARD_MARGIN = 60
MENU_HEIGHT = 120
CELL_LENGTH = 100
PADDING_PERCENT = .20
PADDING = int(CELL_LENGTH * PADDING_PERCENT)
BOARD_LENGTH = 4*CELL_LENGTH + 5*PADDING
SCREEN_WIDTH = 2*BOARD_MARGIN + BOARD_LENGTH
SCREEN_HEIGHT = BOARD_MARGIN + BOARD_LENGTH + MENU_HEIGHT
MENU_BUTTON_COLOR = (166, 139, 114)
MENU_FONT_SIZE = 30
MENU_TEXT_COLOR = (242, 237, 237)
MENU_BUTTON_WIDTH = 150
MENU_BUTTON_HEIGHT = 50
GAME_OVER_BACKGROUND_COLOR = (255, 234, 214)
GAME_OVER_TRANSPARENCY = 125
GAME_OVER_FONT_SIZE = 80
GAME_OVER_TEXT_COLOR = (84, 26, 45)
NEW_GAME_BUTTON_POS_X = SCREEN_WIDTH / 2
NEW_GAME_BUTTON_POS_Y = BOARD_MARGIN + BOARD_LENGTH + MENU_HEIGHT / 2
TILE_MOVE_TIME = 6 # time needed to move all tiles for a single move
PERCENTAGE_NEW_TILE_IS_TWO = .75
TILE_LARGE_FONT_SIZE = 70
TILE_SMALL_FONT_SIZE = 55
TILE_COLORS = {
2: {'fill': (238, 228, 219), 'text': (118, 110, 102)},
4: {'fill': (238, 223, 201), 'text': (118, 110, 102)},
8: {'fill': (241, 177, 125), 'text': (246, 254, 254)},
16: {'fill': (234, 141, 91), 'text': (246, 254, 254)},
32: {'fill': (245, 123, 99), 'text': (246, 254, 254)},
64: {'fill': (232, 91, 63), 'text': (246, 254, 254)},
128: {'fill': (236, 206, 120), 'text': (246, 254, 254)},
256: {'fill': (236, 203, 105), 'text': (246, 254, 254)},
512: {'fill': (236, 199, 90), 'text': (246, 254, 254)},
1024: {'fill': (236, 196, 76), 'text': (246, 254, 254)},
2048: {'fill': (235, 194, 44), 'text': (246, 254, 254)},
4096: {'fill': (99, 217, 148), 'text': (246, 254, 254)},
}
BOARD_COLORS = {
'background': (186, 173, 161),
'empty': (204, 193, 181)
}