Commit 29a4c3a3 by BellCodeEditor

save project

parent b7e6b30f
Showing with 14 additions and 5 deletions
......@@ -22,12 +22,13 @@ click = 0
play_button = stop_img
baba=[]
path='C:\\Users\\Administrator\\Desktop新建文件夹'
path='C:\\Users\\Administrator\\Desktop\\新建文件夹'
filelist=os.listdir(path)
for i in filelist:
if i[-4:]=='.wav' or i[-4:]=='.ogg':
baba.append(i)
num=-1
num = -1
while True:
......@@ -64,19 +65,27 @@ while True:
if x>120 and x<220 and y>350 and y<400:
num-=1
if num<0:
num=len(music_list)-1
pygame.mixer_music.load(path+"\\"+music_list[num])
num=len(baba)-1
pygame.mixer_music.load(path+"\\"+baba[num])
pygame.mixer_music.play()
click=0
if x>420 and x<520 and y>350 and y<400:
num+=1
if num>len(baba)-1:
num=0
pygame.mixer_music.load(path+"\\"+baba[num])
pygame.mixer_music.play()
click=0
if pygame.mixer.music.get_busy() == False:
num+=1
if num>len(baba)-1:
num=0
print(baba)
pygame.mixer.music.load(path+'\\'+baba[num])
pygame.mixer.music.play()
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
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