Commit 7ba63410 by BellCodeEditor

save project

parent dd32cd18
Showing with 4 additions and 3 deletions
......@@ -14,10 +14,11 @@ next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮
music_list = []
path ="C:\\Users\\dell\\Desktop\\text":
path ="C:\\Users\\dell\\Desktop\\text"
filelist = os.listdir(path)
for i in filelist:
if i[-4:] == ".ogg" or i[-4:] == ".wav" or i[-4:] == ".mp3"
if i[-4:] == ".ogg" or i[-4:] == ".wav" or i[-4:] == ".mp3":
music_list.append(i)
num = -1
volume = 0.2
......@@ -60,7 +61,7 @@ while True:
num += 1
if num > len(filelist)-1:
num = 0
pygame.mixer.music.load(filelist[num])
pygame.mixer.music.load(path + "\\"+music_list[num])
pygame.mixer.music.play()
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
......
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