Commit 7e40f964 by BellCodeEditor

save project

parent a1a7a287
Showing with 20 additions and 2 deletions
...@@ -12,9 +12,10 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮 ...@@ -12,9 +12,10 @@ 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_img = pygame.image.load('logo.png') # 下一曲按钮
basic_font=pygame.font.Font('neuropol.ttf',14)
music_list = [] music_list = []
path = "C:\\Users\\Administrator\\Desktop\\tast" path = "C:\\Users\\Huawei\\Desktop\\hhh"
filelist = os.listdir(path) filelist = os.listdir(path)
num = -1 num = -1
for i in filelist: for i in filelist:
...@@ -84,6 +85,21 @@ while True: ...@@ -84,6 +85,21 @@ while True:
num = 0 num = 0
pygame.mixer.music.load(path + "\\" + music_list[num]) pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
musicl=pygame.mixer.Sound(path + "\\" + music_list[num])
music_length=musicl.get_length()
music_length=int(music_length)
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)
info=str(play_m)+':'+str(play_s)
new_logo = pygame.transform.rotate(logo_img, angle) new_logo = pygame.transform.rotate(logo_img, angle)
newRect=new_logo.get_rect(center=(320,200)) newRect=new_logo.get_rect(center=(320,200))
angle += 1 angle += 1
...@@ -92,5 +108,6 @@ while True: ...@@ -92,5 +108,6 @@ while True:
screen.blit(logo_img, (170, 60)) screen.blit(logo_img, (170, 60))
screen.blit(last_img, (120, 350)) screen.blit(last_img, (120, 350))
screen.blit(next_img, (420, 350)) screen.blit(next_img, (420, 350))
scoreSurf=basic_font.render(info,True,(0,0,0))
screen.blit(scoreSurf,(120,440))
pygame.display.update() pygame.display.update()
\ No newline at end of file
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