This repository was archived by the owner on Aug 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 231
Expand file tree
/
Copy pathconstants.py
More file actions
54 lines (44 loc) · 1.53 KB
/
constants.py
File metadata and controls
54 lines (44 loc) · 1.53 KB
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
import config
SIZE = 400
GRID_LEN = 4
GRID_PADDING = 10
BACKGROUND_COLOR_GAME = "#92877d"
BACKGROUND_COLOR_CELL_EMPTY = "#9e948a"
BACKGROUND_COLOR_DICT = {2: "#eee4da", 4: "#ede0c8", 8: "#f2b179",
16: "#f59563", 32: "#f67c5f", 64: "#f65e3b",
128: "#edcf72", 256: "#edcc61", 512: "#edc850",
1024: "#edc53f", 2048: "#edc22e",
4096: "#eee4da", 8192: "#edc22e", 16384: "#f2b179",
32768: "#f59563", 65536: "#f67c5f", }
CELL_COLOR_DICT = {2: "#776e65", 4: "#776e65", 8: "#f9f6f2", 16: "#f9f6f2",
32: "#f9f6f2", 64: "#f9f6f2", 128: "#f9f6f2",
256: "#f9f6f2", 512: "#f9f6f2", 1024: "#f9f6f2",
2048: "#f9f6f2",
4096: "#776e65", 8192: "#f9f6f2", 16384: "#776e65",
32768: "#776e65", 65536: "#f9f6f2", }
FONT = ("Verdana", 40, "bold")
# controls
presets = {
"default": "wasd",
"azerty": "zqsd",
"qwerty": "wasd",
"vim": "khjl"
}
keylayout = config.get_config_option("keylayout")
if keylayout in presets.keys():
KEY_UP = "'"+presets[keylayout][0]+"'"
KEY_DOWN = "'"+presets[keylayout][2]+"'"
KEY_LEFT = "'"+presets[keylayout][1]+"'"
KEY_RIGHT = "'"+presets[keylayout][3]+"'"
elif len(keylayout) == 4:
KEY_UP = "'"+keylayout[0]+"'"
KEY_DOWN = "'"+keylayout[2]+"'"
KEY_LEFT = "'"+keylayout[1]+"'"
KEY_RIGHT = "'"+keylayout[3]+"'"
KEY_BACK = "'b'"
else:
KEY_UP = "'w'"
KEY_DOWN = "'s'"
KEY_LEFT = "'a'"
KEY_RIGHT = "'d'"
KEY_BACK = "'b'"