Commit 52adcf46 by BellCodeEditor

save project

parent 0123b6bb
Showing with 20 additions and 4 deletions
......@@ -13,14 +13,15 @@ last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 中间logo
volume=0.1
pygame.mixer.music.load('明天你好.wav')
font=pygame.font.Font('neuropol.ttf',15)
music_list=[]
path="C:\\Users\\Jason\\Music\\Music1"
filelist=os.listdir(path)
num=-1
angle==0
angle=0
fps=pygame.time.Clock()
for i in filelist:
if i[-3:]=='ogg'or i[-3:]=='wav' :
music_list.append(i)
......@@ -87,11 +88,23 @@ while True:
pygame.mixer.music.play()
click=0
play_button=stop_img
new_logo=pygame.transfor.rorate(logo_img,angle)
new_logo=pygame.transform.rotate(logo_img,angle)
newRect=new_logo.get_rect(center=(320,200))
pos=(newRect[0],newRect[1])
if play_button==stop_img
if play_button==stop_img:
angle+=1
play_time=pygame.mixer.music.get_pos()
play_time=int(play_time/1000)
play_m=play_time//60
play_s=play_time%60
if play_s<10:
play_s='0'+str(play_s)
if play_m<10:
play_m='0'+str(play_m)
info=str(play_m)+':'+str(play_s)
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮
......@@ -99,4 +112,7 @@ while True:
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
# 刷新画面
play_time=font.render(info,True,(255,255,255))
screen.blit(play_time,(120,440))
pygame.display.update()
fps.tick(60)
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