Commit 25c9b425 by BellCodeEditor

save project

parent 29966961
Showing with 8 additions and 0 deletions
...@@ -19,6 +19,8 @@ volume = 0.2 ...@@ -19,6 +19,8 @@ volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量 pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0 click = 0
play_button = stop_img play_button = stop_img
num= -1
music=[1,2,4,3]
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -60,8 +62,14 @@ while True: ...@@ -60,8 +62,14 @@ while True:
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)-1:
num=0
pygame.mixer.music.load(music[num])
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