Commit f1ca5ef7 by BellCodeEditor

save project

parent c2979751
Showing with 8 additions and 1 deletions
...@@ -18,6 +18,12 @@ volume = 0.2 ...@@ -18,6 +18,12 @@ 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
music_list = []
path = "//Users//lihaoming//Desktop"
filelist = os.listdir(path)
for i in filelist:
if i[-4:] == ".ogg" or i[-4:] == ".mp3" or i[-4:] == ".wav":
music_list.append(i)
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -67,8 +73,9 @@ while True: ...@@ -67,8 +73,9 @@ while True:
num += 1 num += 1
if num > len(filelist)-1: if num > len(filelist)-1:
num = 0 num = 0
pygame.mixer.music.load(filelist[num]) pygame.mixer.music.load(path + "//" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
new_logo
# 绘制画面 # 绘制画面
......
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