Commit c5fa32d9 by BellCodeEditor

save project

parent f564aabb
Showing with 14 additions and 7 deletions
...@@ -14,6 +14,13 @@ logo_img = pygame.image.load('logo.png') # 中间logo ...@@ -14,6 +14,13 @@ logo_img = pygame.image.load('logo.png') # 中间logo
pygame.mixer.music.load('歌曲3.wav') pygame.mixer.music.load('歌曲3.wav')
volume = 0.8 volume = 0.8
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
# 音乐
filelist = ['歌曲1.wav', '歌曲2.wav', '歌曲3.wav', '歌曲4.ogg']
num = -1
volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0 click = 0
play_button = stop_img play_button = stop_img
while True: while True:
...@@ -36,13 +43,13 @@ while True: ...@@ -36,13 +43,13 @@ while True:
x, y = event.pos x, y = event.pos
if x > 270 and x < 370 and y > 350 and y < 450: if x > 270 and x < 370 and y > 350 and y < 450:
click += 1 click += 1
if click % 2 == 0: if click % 2 == 0:
play_button = stop_img play_button = stop_img
pygame.mixer.music.unpause() pygame.mixer.music.unpause()
else: else:
play_button = play_img play_button = play_img
pygame.mixer.music.pause() 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