-
Notifications
You must be signed in to change notification settings - Fork 0
/
world.py
133 lines (131 loc) · 4.98 KB
/
world.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Contains the entire map for the game in a dictionary. Also contains the GUI elements for the game.
WORLD = {
'room1': {
'map': [
"#####################",
"# - - - - - - - - - #",
"# - - - -.-.- - - - #",
"# - - - -.-.- - - - #",
"# - - - - - - - - - #",
"#####################",
],
'colors': {
'.': '\x1b[37m', # Grey color for dots
'_': '\x1b[34m', # Blue color for underscores
'#': '\x1b[33m', # Green color for walls
# More mappings for different characters here:
},
'collisions': {
'#': 'player', # Collision layer
# Other collisions here:
},
'chests': {
(5,4): {
'items': {'butter': {
'name': 'Butter',
'color': '\x1b[33m',
'quantity': 1,
'description': 'Another test item.',
'price': 4,
'bought_price': 4,},
}
},
# Another chest here:
},
},
'room2': {
'map': [
"#####",
"#_#_#",
"#___#",
"#####",
],
'colors': {
'#': '\x1b[32m', # Green color for walls
'_': '\x1b[34m', # Blue color for underscores
# You can add more mappings for different characters here
},
'colisions': {
'#': 'player', # Colision layer
# Other collisions here:
}
},
# Add more rooms and their map data here:
}
GUI = {
'gui1': {
'gui': [
"╔═══════════════════════════════════╗",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"╚═══════════════════════════════════╝",
],
'colors': {
'╚': '\x1b[34m', # Blue color for gui
'═': '\x1b[34m',
'║': '\x1b[34m',
'╝': '\x1b[34m',
'╗': '\x1b[34m',
'╔': '\x1b[34m',
# More mappings for different characters here
}
},
'player_inventory': {
'gui': [
"╔═PLAYER═INVENTORY══════════════════╗",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"║ ║",
"╚═══════════════════════════════════╝",
],
'colors': {
'╚': '\x1b[37m', # Blue color for gui
'═': '\x1b[37m',
'║': '\x1b[37m',
'╝': '\x1b[37m',
'╗': '\x1b[37m',
'╔': '\x1b[37m',
# More mappings for different characters here
}
},
'chest_gui': {
'gui': [
"╔═CHEST════════════╦═YOU════════════╗",
"║ ║ ║",
"║ ║ ║",
"║ ║ ║",
"║ ║ ║",
"║ ║ ║",
"║ ║ ║",
"║ ║ ║",
"║ ║ ║",
"║ ║ ║",
"║ ║ ║",
"╚══════════════════╩════════════════╝",
],
'colors': {
'╚': '\x1b[37m', # Blue color for gui
'═': '\x1b[37m',
'║': '\x1b[37m',
'╝': '\x1b[37m',
'╗': '\x1b[37m',
'╔': '\x1b[37m',
# More mappings for different characters here
}
},
}