-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscores.py
53 lines (36 loc) · 1.58 KB
/
scores.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
import pygame.font
from gun import Gun
from pygame.sprite import Group
class Scores():
def __init__(self, screen, stats):
self.screen = screen
self.screen_rect = screen.get_rect()
self.stats = stats
self.text_color = (12, 102, 36)
self.font = pygame.font.SysFont(None, 36)
self.image_score()
self.image_high_score()
self.image_high_score()
#self.image_guns()
def image_score(self):
self.score_img = self.font.render(str(self.stats.scope), True, self.text_color, (0,0,0))
self.score_rect = self.score_img.get_rect()
self.score_rect.right = self.screen_rect.right - 40
self.score_rect.top = 20
def image_high_score(self):
self.high_score_image = self.font.render(str(self.stats.high_score), True, self.text_color, (0,0,0))
self.high_score_rect = self.high_score_image.get_rect()
self.high_score_rect.centerx = self.screen_rect.centerx
self.high_score_rect.top = self.score_rect.top +20
#def image_guns(self):
#
# self.guns = Group()
# for gun_number in range(self.stats.guns_left):
# gun = Gun(self.screen)
# gun.rect.x = 15 + gun_number * gun.rect.width
# gun.rect.y = 20
# self.guns.add(gun)
def show_scope(self):
self.screen.blit(self.score_img, self.score_rect)
self.screen.blit(self.high_score_image, self.high_score_rect)
#self.guns.draw(self.screen)