Commit a339c01f by BellCodeEditor

save project

parent 45cb9ecc
Showing with 9 additions and 0 deletions
...@@ -12,6 +12,7 @@ font = pygame.font.Font('neuropol.ttf',20) ...@@ -12,6 +12,7 @@ font = pygame.font.Font('neuropol.ttf',20)
pygame.mixer.music.load('test.wav') pygame.mixer.music.load('test.wav')
fps = pygame.time.Clock() fps = pygame.time.Clock()
volume = 0.5 volume = 0.5
click = 0
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
while True: while True:
...@@ -27,8 +28,16 @@ while True: ...@@ -27,8 +28,16 @@ while True:
if volume < 1: if volume < 1:
volume += 0.01 volume += 0.01
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
if event.type == locals.MOUSEBUTTONDOWN:
if click == 0:
click = 1
pygame.mixer.music.pause()
if click == 1:
click = 0
pygame.mixer.music.unpause()
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
pygame.mixer.music.play() pygame.mixer.music.play()
screen.blit(background,(0,0)) screen.blit(background,(0,0))
screen.blit(logo,(170,60)) screen.blit(logo,(170,60))
screen.blit(stop,(270,330)) screen.blit(stop,(270,330))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment