Commit 587ccd71 by BellCodeEditor

save project

parent ecdc4490
Showing with 9 additions and 2 deletions
...@@ -13,6 +13,7 @@ next_img = pygame.image.load('next.png') # 下一曲按钮 ...@@ -13,6 +13,7 @@ next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # logo按钮 logo_img = pygame.image.load('logo.png') # logo按钮
# 载入音乐 # 载入音乐
import os
music_list = [] music_list = []
path = "D:\\" path = "D:\\"
filelist = os.listdir(path) filelist = os.listdir(path)
...@@ -55,8 +56,14 @@ while True: ...@@ -55,8 +56,14 @@ while True:
play_button = stop_img play_button = stop_img
pygame.mixer.music.unpause() pygame.mixer.music.unpause()
else: else:
play_button = play_img if x>120 and x<220 and y>350 and y<400:#上一曲按键的占位置
pygame.mixer.music.pause() num -= 1
if num<0:
num = len(music_list)-1
pygame.mixer.music.load(path+"\\"+music_list[num])
pygame.mixer.music.play()
play_button = stop_img
click = 0
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
num += 1 num += 1
......
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