Commit e1dc176b by BellCodeEditor

save project

parent dac5c863
Showing with 4 additions and 4 deletions
...@@ -11,14 +11,14 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮 ...@@ -11,14 +11,14 @@ 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 logo_img = pygame.image.load('logo.png') # 中间logo
music_list=[] music_list=["歌曲1.wav","歌曲4.ogg","歌曲3.wav","歌曲2.wav"]
num=-1 num=-1
volume=0.1 volume=0.1
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
click=0 click=0
play_button=stop_img play_button=stop_img
path='C:\\Users\\HP\\Desktop\\text' # path='C:\\Users\\HP\\Desktop\\text'
filelist=os.listdir(path) # filelist=os.listdir(path)
for i in filelist: for i in filelist:
if i[-4:]=='.wav' or i[-4:]=='.ogg': if i[-4:]=='.wav' or i[-4:]=='.ogg':
music_list.append(i) music_list.append(i)
...@@ -53,7 +53,7 @@ while True: ...@@ -53,7 +53,7 @@ while True:
num-=1 num-=1
if num<0: if num<0:
num=0 num=0
pygame.mixer.music.load(path+'\\'+music_list[num]) pygame.mixer.music.load(music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
if x>420 and x<520 and y>350 and y<400: if x>420 and x<520 and y>350 and y<400:
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