- Added initial sound class
parent
7260765327
commit
c1f1c85d45
20
avocado.py
20
avocado.py
|
@ -80,4 +80,24 @@ class Avocado:
|
||||||
print('platch')
|
print('platch')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def mute(self,mute=False):
|
||||||
|
if mute:
|
||||||
|
pygame.mixer.music.set_volume(0.0)
|
||||||
|
else:
|
||||||
|
pygame.mixer.music.set_volume(0.5)
|
||||||
|
|
||||||
|
def playLevel(self,lvl=1):
|
||||||
|
if lvl == 1:
|
||||||
|
pygame.mixer.music.load("""audio/level1.wav""")
|
||||||
|
elif lvl == 2:
|
||||||
|
pygame.mixer.music.load("""audio/level2.wav""")
|
||||||
|
elif lvl == 3:
|
||||||
|
pygame.mixer.music.load("""audio/level3.wav""")
|
||||||
|
pygame.mixer.music.play()
|
||||||
|
|
||||||
|
def fade(self):
|
||||||
|
pygame.mixer.music.fadeout(3000)
|
||||||
|
|
||||||
|
def loadClick(self):
|
||||||
|
self.click = pygame.mixer.Sound("audio/click.wav")
|
||||||
|
return self.click
|
||||||
|
|
2
game.py
2
game.py
|
@ -21,6 +21,8 @@ def initialize_screen():
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
pygame.init()
|
pygame.init()
|
||||||
|
pygame.mixer.init()
|
||||||
|
pygame.mixer.music.set_volume(0.5)
|
||||||
pygame.display.set_caption('Pin Avo, the Cado!')
|
pygame.display.set_caption('Pin Avo, the Cado!')
|
||||||
clock = pygame.time.Clock()
|
clock = pygame.time.Clock()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue