-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHighScoresScenes.py
81 lines (57 loc) · 1.96 KB
/
HighScoresScenes.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
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 23 19:48:58 2023
@author: carol
"""
from Assets import Display
from SharedAssetsScenes import Scene
from Constants import c
class HighScores(Scene):
def __init__(self, window):
super().__init__(window)
self.id = 'scores'
self.assets = self.scores_assets()
self.screen_mgr = Display(self.window, *self.assets)
self.screen_mgr.update()
def handle(self, events, keys_down):
for event in events:
if self.start_button.handle(event):
self.go_to('play')
if self.home_button.handle(event):
self.go_to('intro')
if self.garbage_button.handle(event):
self.score_data.reset()
self.assets = self.scores_assets()
self.screen_mgr = Display(self.window, *self.assets)
self.sound_button.on = self.data_dic['sound']
self.screen_mgr.update()
self.history_button.disable()
self.history_button.state = 'disabled'
self.shared_handle(event)
def enter(self, data):
self.assets = self.scores_assets()
self.screen_mgr = Display(self.window, *self.assets)
self.screen_mgr.update()
self.sound_button.on = self.data_dic['sound']
self.history_button.disable()
self.history_button.state = 'disabled'
def update(self):
# self.sound_button.on = self.data_dic['sound']
pass
def leave(self):
# self.data_dic['sound'] = self.sound_button.on
pass
def draw(self):
# self.window.fill('blue')
self.window.fill('turquoise3')
self.screen_mgr.draw()
if (__name__ == '__main__'):
from Helpers import window_init, loop
window_size = (c('width_window'), c('height_window'))
window = window_init(size=window_size, color='red')
scores = HighScores(window)
loop()
"""
pygame.quit()
quit()
"""