This repository has been archived by the owner on Apr 28, 2024. It is now read-only.
forked from yildizahmett/tetris2048
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.py
81 lines (79 loc) · 1.99 KB
/
utils.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
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
from lib.color import Color
TILE_COLORS = {
2: {
"background_color": Color(238, 228, 218),
"foreground_color": Color(138, 129, 120)
},
4:{
"background_color": Color(236, 224, 200),
"foreground_color": Color(138, 129, 120)
},
8:{
"background_color": Color(243, 177, 121),
"foreground_color": Color(255, 255, 255)
},
16:{
"background_color": Color(245, 150, 98),
"foreground_color": Color(255, 255, 255)
},
32:{
"background_color": Color(249, 123, 97),
"foreground_color": Color(255, 255, 255)
},
64:{
"background_color": Color(245, 100, 60),
"foreground_color": Color(255, 255, 255)
},
128:{
"background_color": Color(238, 228, 218),
"foreground_color": Color(255, 255, 255)
},
256:{
"background_color": Color(237, 203, 99),
"foreground_color": Color(255, 255, 255)
},
512:{
"background_color": Color(238, 201, 84),
"foreground_color": Color(255, 255, 255)
},
1024:{
"background_color": Color(239, 196, 64),
"foreground_color": Color(255, 255, 255)
},
2048:{
"background_color": Color(238, 194, 45),
"foreground_color": Color(255, 255, 255)
}
}
def get_next_display_dict(grid_width):
TILE_NEXT_DISPLAY = {
"I":{
'x': grid_width + 1,
'y': 1
},
"J":{
'x': grid_width + 1.5,
'y': 2
},
"L":{
'x': grid_width + 0.5,
'y': 2
},
"O":{
'x': grid_width + 1.5,
'y': 3
},
"T":{
'x': grid_width + 1,
'y': 3
},
"S":{
'x': grid_width + 1,
'y': 2
},
"Z":{
'x': grid_width + 1,
'y': 2
}
}
return TILE_NEXT_DISPLAY