Commit 7e4c477c by BellCodeEditor

save project

parent 07e7f88a
Showing with 11 additions and 4 deletions
......@@ -13,7 +13,7 @@ last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮
num=-1
path="C:\\Users\\Administrator\\Desktop\\nmb"
path="C:\\Users\\student\\Desktop\\nmb"
filelist=os.listdir(path)
B=[]
for i in filelist:
......@@ -69,12 +69,17 @@ while True:
click=2
pygame.mixer.music.load(path+"\\"+B[num])
pygame.mixer.music.play()
if x>420 and x<520 and y>350 and y<400:
num+=1
if num>len(B)-1:
num=0
pygame.mixer.music.load(path+"\\"+B[num])
pygame.mixer.music.play()
if pygame.mixer.music.get_busy() == False:
num = -1
if num >len(path)-1:
num +=1
if num >len(B)-1:
num=0
pygame.mixer.music.load(path+"\\"+B[num])
pygame.mixer.music.play()
......@@ -82,6 +87,8 @@ while True:
# 绘制画面
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