Commit 2fa8e2cd by BellCodeEditor

save project

parent d369d728
Showing with 10 additions and 11 deletions
......@@ -18,17 +18,16 @@ while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
'''
if event.key==pygame.K_DOWN:
volume-=0.2
if volume<0:
volume=0
if event.key==pygame.K_UP:
volume+=0.2
if volume>1:
volume=1
'''
#pygame.mixer_music.set_volume(volume)
if event.type==pygame.KEYDOWN:
if event.key==pygame.K_DOWN:
volume-=0.2
if volume<0:
volume=0
if event.key==pygame.K_UP:
volume+=0.2
if volume>1:
volume=1
pygame.mixer_music.set_volume(volume)
if pygame.mixer.music.get_busy() == False: # 音乐是否正在播放
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