Commit 8168273e by BellCodeEditor

save project

parent f35ce1dc
Showing with 7 additions and 3 deletions
......@@ -6,6 +6,7 @@ pygame.init() # 初始化
screen = pygame.display.set_mode((640, 480))
# 载入图片、资源
pygame.mixer.music.set_volume(volume)
click=0
bg_img = pygame.image.load('background.png') # 背景图
play_img = pygame.image.load('play.png') # 播放按钮
stop_img = pygame.image.load('stop.png') # 暂停按钮
......@@ -26,10 +27,13 @@ while True:
volume-=0.1
if volume<0:
volume=0
pygame.mixer.music.set_volume(volume)
if event.type==locals.MOUSEBUTTONDOWN:
click+=1
if click%2==0:
pygame.mixer.music.unpause()
else:
pygame.mixer.music.pause()
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