Commit 94cbe74f by BellCodeEditor

save project

parent 4e502657
Showing with 5 additions and 5 deletions
...@@ -16,7 +16,7 @@ volume=0.5 ...@@ -16,7 +16,7 @@ volume=0.5
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT(): if event.type == locals.QUIT:
exit() exit()
if event.type==locals.KEYDOWN: if event.type==locals.KEYDOWN:
if event.key==locals.K_UP: if event.key==locals.K_UP:
...@@ -25,10 +25,10 @@ while True: ...@@ -25,10 +25,10 @@ while True:
volume=1 volume=1
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
if event.key==locals.K_UP: if event.key==locals.K_DOWN:
volume += 0.05 volume -= 0.05
if volume > 1: if volume <0:
volume=1 volume=0
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
if pygame.mixer.music.get_busy == False: if pygame.mixer.music.get_busy == False:
pygame.mixer.music.play() pygame.mixer.music.play()
......
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