Commit 438d291a by BellCodeEditor

save project

parent 9037e9ea
Showing with 10 additions and 2 deletions
...@@ -14,7 +14,7 @@ next_img = pygame.image.load('next.png') # 下一曲按钮 ...@@ -14,7 +14,7 @@ next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮 logo_img = pygame.image.load('logo.png') # 下一曲按钮
music_list = [] music_list = []
path = "C:\\Users\\student\\Documents\\新建文件夹" path = "C:\\Users\\student\\Desktop\\111"
filelist = os.listdir(path) filelist = os.listdir(path)
num = -1 num = -1
...@@ -86,6 +86,11 @@ while True: ...@@ -86,6 +86,11 @@ 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()
play_time = pygame.mixer.music.get_pos()
play_time=int(play_time/1000)
play_m=play_time // 60
play_s=play_time % 60
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))
pos=(newRect[0],newRect[1]) pos=(newRect[0],newRect[1])
...@@ -101,6 +106,8 @@ while True: ...@@ -101,6 +106,8 @@ while True:
screen.blit(new_logo, pos) # 中间logo图 screen.blit(new_logo, pos) # 中间logo图
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,Ture,(255,255,255))
screen.blit(scoreSurf,(120,440))
# 刷新画面 # 刷新画面
scoreSurf=bafic_font. #scoreSurf=bafic_font.
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