Commit 1192198e by BellCodeEditor

save project

parent 24a55e27
Showing with 5 additions and 1 deletions
...@@ -16,7 +16,7 @@ volume=0.1 ...@@ -16,7 +16,7 @@ volume=0.1
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
click = 0 click = 0
play_button = stop_img play_button = stop_img
music_list=['歌曲1.wav','歌曲2wav','歌曲3wav','歌曲4ogg']
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:
...@@ -43,7 +43,11 @@ while True: ...@@ -43,7 +43,11 @@ while True:
else: else:
play_button = play_img play_button = play_img
pygame.mixer.music.pause() pygame.mixer.music.pause()
if pygame.mixer.music.get_busy == False: if pygame.mixer.music.get_busy == False:
num += 1
if num > len(music_list)-1:
num = 0
pygame.mixer.music.play() # 绘制画面 pygame.mixer.music.play() # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮 screen.blit(play_button, (270, 330)) # 暂停按钮
......
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