-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfinal.py
75 lines (63 loc) · 2.19 KB
/
final.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
import sprites as sp
import pygame
import var
import random
import time
import generic as gen
import defaults as df
import device
import zombies as zmb
print('Loading final')
class AddScreen(gen.Xscreen):
def __init__(self):
gen.Xscreen.__init__(self)
print('final screen created')
self.font1.color = df.orange
self.font1.font_size = 40
self.font1.set_font()
self.backMusicFile = var.assetsDir + 'sounds/732704_Otravine_chop.wav'
def run(self):
# background = sp.Sprite2(v, 0, 0, df.display_width, df.display_height, 0, 0)
mapsback = sp.Sprite2()
mapsback.file = var.assetsDir + 'backgrounds/end.jpg'
mapsback.w = df.display_width
mapsback.h = df.display_height
mapsback.set_image()
mapsback.rect.x = 0
mapsback.rect.y = 0
total_time = 0
#
# horde = zmb.Horde()
# horde.map_gap = 10
# horde.limit = 200
# # horde.update()
horde = zmb.Horde()
horde.map_gap = 10
horde.limit = 100
horde.born()
# for i in range(1, horde.limit + 1):
# horde.time_to_born.append(i * 100)
#
self.loadMusic()
self.playBackMusic()
dt = 50
while not self.stopEngine:
time_start = pygame.time.get_ticks()
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
self.stopEngine = True
var.gameDisplay.fill(df.black)
self.draw_sprite2(mapsback)
for enemy in horde.enemies:
enemy.animate(dt)
# print(enemy.rect.x)
self.draw_selected((35,0), (df.display_width, 50), 100, df.white)
self.message_display('Thanks.. Danke... Gracias', (35, 20))
dt = pygame.time.get_ticks() - time_start
pygame.display.update()
# var.clock.tick(var.fps)
total_time += dt