-
Notifications
You must be signed in to change notification settings - Fork 0
/
sounds.py
76 lines (62 loc) · 2.45 KB
/
sounds.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
import pygame
class Sounds(object):
def __init__(self, game):
self.game = game
self.volume = 0.1
self.i = 0
def music(self):
if self.game.level == 0 or self.game.level == 3:
pygame.mixer.music.set_volume(0.1)
pygame.mixer.music.load("music/easy_4.mp3")
pygame.mixer.music.play()
else:
pygame.mixer.music.stop()
if self.game.win == 2:
pygame.mixer.music.set_volume(0.1)
# muzyka zwycięstwa
pygame.mixer.music.load("music/win.mp3")
pygame.mixer.music.play()
if self.game.win == 5:
pygame.mixer.music.set_volume(0.1)
# muzyka przegranej
pygame.mixer.music.load("music/defeat.mp3")
pygame.mixer.music.play()
elif self.game.win == 1:
pygame.mixer.music.set_volume(0.15)
# muzyka hard
if self.i == 0:
pygame.mixer.music.load("music/hard_1.mp3")
self.i = 1
elif self.i == 1:
pygame.mixer.music.load("music/hard_2.mp3")
self.i = 2
elif self.i == 2:
pygame.mixer.music.load("music/hard_3.mp3")
self.i = 0
pygame.mixer.music.play()
elif self.game.win == 3:
pygame.mixer.music.set_volume(0.15)
# muzyka medium
if self.i == 0:
pygame.mixer.music.load("music/medium_1.mp3")
self.i = 1
elif self.i == 1:
pygame.mixer.music.load("music/medium_2.mp3")
self.i = 2
elif self.i == 2:
pygame.mixer.music.load("music/medium_3.mp3")
self.i = 0
pygame.mixer.music.play()
elif self.game.win == 4:
pygame.mixer.music.set_volume(0.45)
# muzyka easy
if self.i == 0:
pygame.mixer.music.load("music/easy_1.mp3")
self.i = 1
elif self.i == 1:
pygame.mixer.music.load("music/easy_2.mp3")
self.i = 2
elif self.i == 2:
pygame.mixer.music.load("music/easy_3.mp3")
self.i = 0
pygame.mixer.music.play()