Commit 68cd6948 by BellCodeEditor

auto save

parent 2d5686f9
Showing with 10 additions and 3 deletions
...@@ -11,7 +11,12 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮 ...@@ -11,7 +11,12 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮 last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮 next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮 logo_img = pygame.image.load('logo.png') # 下一曲按钮
e=[]
path='C:\\Users\\86139\\Desktop'
filelist=os.listdir(path)
for i in filelist:
if i[-4:]=='.ogg' or i[-4:]=='.wav':
e.append(i)
# 载入音乐pygame.mixer.music.load('歌曲2.wav') # 载入音乐pygame.mixer.music.load('歌曲2.wav')
q=['歌曲1.wav','歌曲2.wav','歌曲3.wav','歌曲4.ogg'] q=['歌曲1.wav','歌曲2.wav','歌曲3.wav','歌曲4.ogg']
w=-1 w=-1
...@@ -52,9 +57,11 @@ while True: ...@@ -52,9 +57,11 @@ while True:
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
w=w+1 w=w+1
if w>len('music_list')-1: if w>len('filelist')-1:
w=0 w=0
print(w)
pygame.mixer.music.load(path+'\\'+e[w])
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