forked from MaxwellSalmon/DUGA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSETTINGS.py
279 lines (247 loc) · 5.43 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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
#Settings for DUGA
'''Game settings'''
current_level = 0
fps = 31
caption = "DUGA Beta v1.3"
mode = 1
volume = 1
music_volume = 1
fullscreen = False
menu_showing = True
#Below this point are the non-configurable game variables.
current_level_size = None
changing_level = False
quit_game = False
game_won = False
dt = 0
cfps = 0
statistics = {}
play_seconds = 0
'''Level settings'''
glevels_size = 4
glevels_amount = 100
#These are non-configurable.
levels_list = []
segments_list = []
clevels_list = []
glevels_list = []
tlevels_list = []
seed = None
playing_customs = False
playing_new = False
playing_tutorial = False
'''Canvas settings'''
canvas_target_width = 700 #700
canvas_target_height = 550 #600
#Below this point are the non-configurable canvas variables.
canvas_actual_width = 0
canvas_map_width = None
canvas_map_height = None
window_height = int(canvas_target_height + (canvas_target_height *0.15))
switch_mode = False
axes = (0, 0)
screen_shake = 0
'''Raycasting settings'''
resolution = 140
fov = 60
render = 10
shade = False
shade_rgba = (0,0,0,255)
shade_visibility = 1000
#Below this point are the non-configurable raycasting variables.
zbuffer = []
middle_slice_len = None
middle_slice = None
middle_ray_pos = None
raylines = []
'''Tile settings'''
tile_size = 64
#Below this point are the non-configurable tile variables.
all_tiles = []
trigger_tiles = []
all_solid_tiles = []
rendered_tiles = []
walkable_area = []
all_doors = []
end_angle = 0
'''Player settings'''
#Speed in px/s
player_speed = 256
sensitivity = 0.25
player_angle = 270
og_player_health = 25
og_player_armor = 5
godmode = False
#Below this point are the non-configurable player variables.
player_health = og_player_health
player_armor = og_player_armor
player_pos = [0,0]
player_map_pos = []
player_rect = None
mouse_btn_active = False
mouse2_btn_active = False
reload_key_active = False
aiming = False
player_states = {
'dead' : False,
'hurt' : False,
'heal' : False,
'armor' : False,
'invopen' : False,
'fade' : False,
'black' : False,
'title' : False,
'cspeed' : 0,
}
player = None
last_player_map_pos = None
'''Texture settings'''
#Wall textures and sprites go here.
texture_darken = 100
texture_list = []
'''Weapon settings'''
#Settings for guns and ammo go here.
unlimited_ammo = False
#Below this point are non-configurable variables.
current_gun = None
next_gun = None
prev_gun = None
gun_list = []
ground_weapon = None
'''NPC settings'''
#NPC information goes here
ignore_player = False
#Below this point are non-configurable variables.
npc_list = []
npc_types = []
npc_soundpacks = []
'''Inventory settings'''
#This is for scripts to access inventory data - Not configurable
held_ammo = {}
max_ammo = {}
inventory = {
'primary': None,
'secondary': None,
'melee': None}
item_types = []
inv_strings_updated = False
'''Tile configurations'''
#Assign each kind of tile with a texture or sprite
tile_texture = {}
tile_solid = {
0 : False,
1 : True,
2 : True,
3 : True,
4 : True,
5 : True,
6 : True,
7 : True,
8 : True,
9 : True,
10 : False,
11 : True,
12 : True,
13 : True,
14 : True,
15 : True,
16 : True,
17 : True,
18 : True,
19 : True,
20 : True,
21 : True,
22 : True,
23 : True,
24 : True,
25 : True,
}
tile_visible = { #Sprite tiles are not visible
0 : False,
1 : True,
2 : True,
3 : True,
4 : True,
5 : True,
6 : True,
7 : True,
8 : False,
9 : False,
10 : False,
11 : True,
12 : True,
13 : True,
14 : True,
15 : True,
16 : False,
17 : False,
18 : False,
19 : True,
20 : True,
21 : True,
22 : True,
23 : True,
24 : True,
25 : False,
}
texture_type = { #air, wall, trigger, sprite
0 : 'air',
1 : 'wall',
2 : 'wall',
3 : 'wall',
4 : 'wall',
5 : 'end',
6 : 'vdoor',
7 : 'hdoor',
8 : 'sprite',
9 : 'sprite',
10 : 'sprite',
11 : 'wall',
12 : 'wall',
13 : 'wall',
14 : 'wall',
15 : 'end',
16 : 'sprite',
17 : 'sprite',
18 : 'sprite',
19 : 'wall',
20 : 'wall',
21 : 'wall',
22 : 'end',
23 : 'vdoor',
24 : 'hdoor',
25 : 'sprite',
}
'''Sprite settings'''
all_sprites = []
'''Item settings'''
all_items = []
'''Colours'''
BLACK = (0, 0, 0)
BLUE = (0, 0, 255)
BROWN = (140, 50, 20)
DARKGRAY = (50, 50, 50)
DARKRED = (80, 0, 0)
DARKGREEN = (0, 100, 0)
GRAY = (100, 100, 100)
GREEN = (0, 255, 0)
LIGHTBLUE = (100, 100, 225)
LIGHTGRAY = (150, 150, 150)
LIGHTGREEN = (100, 255, 100)
RED = (255, 0, 0)
WHITE = (255, 255, 255)
YELLOW = (255, 255, 0)
#Create a new tile / sprite tile:
#1. Create texture and add it to TEXTURES.py in the marked area for tiles.
#2. Give the tile by ID the settings you want in dictionaries above.
#3. Make sure that all tiles has a texture or sprite. Invisible tiles can use null.png
#4. Note that Sprite tiles are not visible. The tile itself is not rendered.
#Note: A tile can be solid, but invisible, but not vice versa
#Create a new sprite (NPC):
#1. Create the texture and add it to TEXTURES.py in the marked area for NPC's
#2. Assign the sprite an ID and make sure the sprite is added to SETTINGS.all_sprites.
#3. Add the sprite (ID) to the texture_type dictionary above. Call it 'sprite'.
#4. Fill out the arguments to make a sprite (pos, path)
#Controls
#Overvej at lave justerbare controls
temp = []