Commit 1c9b12a0 by BellCodeEditor

save project

parent e3015f5a
Showing with 6 additions and 6 deletions
......@@ -12,11 +12,11 @@ logo_img = pygame.image.load('logo.png') # 下一曲按钮
# 载入音乐
music_list = []
path = 'C:\\Users\\Administrator\\Desktop'
path = 'C:\\Users\\Administrator\\Desktop\\test'
filelist = os.listdir(path)
for i in filelist:
if i[-4:] == ".wav" or i[-4:] == ".ogg":
music_list.appand(i)
music_list.append(i)
volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0
......@@ -53,7 +53,7 @@ while True:
play_button = play_img
pygame.mixer.music.pause()
if x>120 and x<220 and y>350 and y<450:
if x>120 and x<220 and y>350 and y<400:
num-=1
if num<0:
num = len(music_list)-1
......@@ -62,10 +62,10 @@ while True:
click = 0
play_button = stop_img
if x>320 and x<420 and y>350 and y<400:
if x>420 and x<540 and y>350 and y<400:
num+=1
if num>3:
num = len(music_list)+1
num = len(music_list)-4
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
click = 3
......@@ -75,7 +75,7 @@ while True:
num += 1
if num > len(music_list)-1:
num = 0
pygame.mixer.music.load(path + "\\" + music_list[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