Commit 434673b8 by BellCodeEditor

save project

parent 08ef023a
Showing with 11 additions and 1 deletions
...@@ -14,6 +14,7 @@ logo_img = pygame.image.load('logo.png') # 中间logo ...@@ -14,6 +14,7 @@ logo_img = pygame.image.load('logo.png') # 中间logo
pygame.mixer_music.load("歌曲1.wav") pygame.mixer_music.load("歌曲1.wav")
volume = 0.5 volume = 0.5
click = 0
while True: while True:
pygame.mixer_music.set_volume(volume) pygame.mixer_music.set_volume(volume)
...@@ -30,9 +31,18 @@ while True: ...@@ -30,9 +31,18 @@ while True:
if volume < 0: if volume < 0:
volume =0 volume =0
if pygame.mixer_music.get_busy() == False: if pygame.mixer_music.get_busy() == False:
pygame.mixer_music.play() pygame.mixer_music.play()
if event.type == locals.MOUSEBUTTONDOWN:
x,y = event.pos
if
click +=1
if click % 2 == 0:
pay_button = stop_img
pygame.mixer_music.unpause()
else:
play_button = play_img
pygame.mixer_music.pause()
# 绘制画面 # 绘制画面
......
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