-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·370 lines (294 loc) · 11.5 KB
/
main.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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
import pygame
# import time
import Nivel_Tres
import animaciones
import Niveles
import Nivel_Dos
import Menus
# import threading
import Arquitectura
import Desisiones
import nivel_cuatro
"""def temporizador():
i = 60
while i > 0:
print(i)
i -= 1
time.sleep(1)
print("time off")"""
def main():
done = False
score = None
bases = None
pygame.init()
pygame.mixer.init()
ANCHO = 1300
ALTO = 700
clock = pygame.time.Clock()
ventana = pygame.display.set_mode((ANCHO, ALTO)) # ventana
pygame.display.set_caption('Legends Don\'t Crumble ') # titulo
pygame.display.set_icon(pygame.image.load('img/escudosin.png'))
pygame.mixer.music.load('music/Passengers.mp3')
pygame.mixer.music.set_volume(0.2)
menu_ini = True
cinematic_ini = False
Nivel_uno = False
arco = False
Nivel_dos = False
acueducto = False
billingue = False
templo = False
Nivel_tres = False
las_termas = False
casamiento = False
coliseo = False
Nivel_cuatro = False
teatro = False
financiar = False
hijos = False
ganar = False
while not done:
for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True
pygame.quit()
exit()
if menu_ini:
Menus.inicial(ventana, clock)
cinematic_ini = True
# animaciones.movimientos_germanos(ventana, clock)
# animaciones.filosofo(ventana, clock)
# animaciones.win(ventana, clock)
# animaciones.unlock_all_croma(ventana, clock, "bonito")
# animaciones.lose(ventana, clock, 50, "bonito")
# animaciones.estado_final(ventana, clock, 50, "bonito")
if cinematic_ini:
animaciones.inicial(ventana, clock)
cinematic_ini = False
Nivel_uno = True
if Nivel_uno:
animaciones.movimientos_hunos(ventana, clock)
pygame.mixer.music.play(-1)
Niveles.nivel_uno(ventana, clock)
Niveles.segunda_tirada(ventana, clock)
score = Niveles.points()
cont = Niveles.conti()
if cont:
if score > 0:
arco = True
animaciones.croma_init(ventana, clock, score)
else:
animaciones.lose(ventana, clock, score, bases)
Nivel_uno = False
bases = animaciones.base()
if arco:
correcta = Arquitectura.donde_vamos("arco")
Arquitectura.arco(ventana, clock, 50, correcta, bases)
score = Arquitectura.points()
cont = Arquitectura.continuar()
if cont:
if score > 0:
Nivel_dos = True
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
arco = False
else:
animaciones.lose(ventana, clock, score, bases)
if Nivel_dos:
animaciones.movimientos_vandalos(ventana, clock)
Nivel_Dos.nivel(ventana, clock, score)
score = Nivel_Dos.points()
if score > 0:
acueducto = True
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
Nivel_dos = False
# animaciones.croma_level2()
if acueducto:
correcta = Arquitectura.donde_vamos("acueducto")
Arquitectura.arco(ventana, clock, score, correcta, bases)
score = Arquitectura.points()
cont = Arquitectura.continuar()
if cont:
if score > 0:
billingue = True
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
else:
animaciones.lose(ventana, clock, score, bases)
acueducto = False
if billingue:
sub = Desisiones.hay_que_desidir("billingue")
Desisiones.desicion(ventana, clock, score, sub, bases)
score = Desisiones.points()
if score > 0:
templo = True
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
billingue = False
if templo:
correcta = Arquitectura.donde_vamos("templo")
Arquitectura.arco(ventana, clock, score, correcta, bases)
score = Arquitectura.points()
cont = Arquitectura.continuar()
if cont:
if score > 0:
Nivel_tres = True
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
else:
animaciones.lose(ventana, clock, score, bases)
templo = False
if Nivel_tres:
animaciones.movimientos_germanos(ventana, clock)
Nivel_Tres.nivel(ventana, clock, score)
score = Nivel_Tres.points()
if score > 0:
las_termas = True
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
Nivel_tres = False
if las_termas:
correcta = Arquitectura.donde_vamos("termas")
Arquitectura.arco(ventana, clock, score, correcta, bases)
score = Arquitectura.points()
cont = Arquitectura.continuar()
if cont:
if score > 0:
casamiento = True
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
else:
animaciones.lose(ventana, clock, score, bases)
las_termas = False
if casamiento:
sub = Desisiones.hay_que_desidir("casamiento")
Desisiones.desicion(ventana, clock, score, sub, bases)
score = Desisiones.points()
if score > 0:
coliseo = True
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
casamiento = False
if coliseo:
correcta = Arquitectura.donde_vamos("coliseo")
Arquitectura.arco(ventana, clock, score, correcta, bases)
score = Arquitectura.points()
cont = Arquitectura.continuar()
if cont:
if score > 0:
Nivel_cuatro = True
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
else:
animaciones.lose(ventana, clock, score, bases)
coliseo = False
if Nivel_cuatro:
animaciones.filosofo(ventana, clock)
nivel_cuatro.hay_que_desidir("1")
nivel_cuatro.desicion(ventana, clock, score)
score = nivel_cuatro.points()
if score > 0:
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
nivel_cuatro.hay_que_desidir("2")
nivel_cuatro.desicion(ventana, clock, score)
score = nivel_cuatro.points()
if score > 0:
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
nivel_cuatro.hay_que_desidir("3")
nivel_cuatro.desicion(ventana, clock, score)
score = nivel_cuatro.points()
if score > 0:
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
nivel_cuatro.hay_que_desidir("4")
nivel_cuatro.desicion(ventana, clock, score)
score = nivel_cuatro.points()
if score > 0:
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
nivel_cuatro.hay_que_desidir("5")
nivel_cuatro.desicion(ventana, clock, score)
score = nivel_cuatro.points()
if score > 0:
teatro = True
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
Nivel_cuatro = False
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
if teatro:
correcta = Arquitectura.donde_vamos("teatro")
Arquitectura.arco(ventana, clock, score, correcta, bases)
score = Arquitectura.points()
cont = Arquitectura.continuar()
if cont:
if score > 0:
financiar = True
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
else:
animaciones.lose(ventana, clock, score, bases)
teatro = False
if financiar:
sub = Desisiones.hay_que_desidir("financiar")
Desisiones.desicion(ventana, clock, score, sub, bases)
score = Desisiones.points()
if score > 0:
hijos = True
if score >= 100:
animaciones.selec_croma(ventana, clock, bases)
else:
animaciones.lose(ventana, clock, score, bases)
financiar = False
if hijos:
sub = Desisiones.hay_que_desidir("hijos")
Desisiones.desicion(ventana, clock, score, sub, bases)
score = Desisiones.points()
if score > 0:
ganar = True
if score >= 100:
animaciones.croma_level3(ventana, clock, bases, score)
else:
animaciones.lose(ventana, clock, score, bases)
if ganar:
animaciones.win(ventana, clock)
animaciones.estado_final(ventana, clock, score, bases)
animaciones.descargo(ventana, clock)
if __name__ == '__main__':
# principal_hilo = threading.Thread(target=main, name="main")
# hilo_daemon = threading.Thread(target=temporizador, name="temporizador", daemon=True)
# principal_hilo.start()
main()