-
Notifications
You must be signed in to change notification settings - Fork 0
/
Details.py
39 lines (32 loc) · 1.19 KB
/
Details.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
import os
import pygame
from pygame import mixer
from win32api import GetSystemMetrics
import Game
class Details:
def __init__(self):
pygame.init()
mixer.init()
mixer.music.load(os.path.join("audio", "background.wav"))
mixer.music.play(-1)
self.BGMusic = True
self.screen = pygame.display.set_mode((GetSystemMetrics(0), GetSystemMetrics(1)))
def render(self, DISPLAYNAME):
while True:
pygame.display.set_caption(DISPLAYNAME)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
return
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_m:
if self.BGMusic:
mixer.music.pause()
self.BGMusic = False
else:
mixer.music.unpause()
self.BGMusic = True
if event.key in (pygame.K_BACKSPACE, pygame.K_ESCAPE):
pygame.quit()
Game.Game.Locker()
pygame.display.update()