def handleEvents(self, event, fpsClock):
if event.type == pygame.MOUSEBUTTONDOWN:
# Play sound
self.sound_beep1.play()
if event.type == pygame.MOUSEBUTTONUP:
if (not self.layer2[0].visible):
for sprite in self.layer1: sprite.visible = False
for sprite in self.layer2: sprite.visible = True
Sound("assets/audio/enter_authorization_code.wav").play()
elif (self.pin_i == len(str(self.pin))):
# Ran out of button presses
if (self.correct == 4):
self.sound_granted.play()
from screens.main import ScreenMain
self.loadScreen(ScreenMain())
else:
self.sound_deny2.play()
self.sound_denied.play()
self.reset()
return False
评论列表
文章目录