Commit 998dd7c4 by BellCodeEditor

save project

parent 7d85d35f
Showing with 30 additions and 2 deletions
......@@ -76,6 +76,30 @@ while True:
click += 2
else:
click += 1
play_time = pygame.mixer.music.get_pos()
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)
if play_s<10:
play_s="0"+str(play_s)
info=str(play_m)+":"+str(play_s)
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) # 2位数来显示秒数
info = str(play_m) + ":" + str(play_s) # 格式化成“分:秒”格式
# 绘制时间进度
scoreSurf = basic_font.render(info, True, (255, 255, 255))
screen.blit(scoreSurf, (120,440))
music1 = pygame.mixer.Sound(path + "\\" + music_list[num]) # Sound方法将歌曲完整加载
music_length = music1.get_length() # get_length()方法,取得总时长
music_length = int(music_length)
if pygame.mixer.music.get_busy() == False:
num += 1
......@@ -93,6 +117,9 @@ while True:
screen.blit(new_logo, pos)
screen.blit(last_img, (120, 350))
screen.blit(next_img, (420, 350))
screen.blit(next_img, (420, 350))
scareSurf=basic_font.render(info,True,(255,255,255))
screen.blit(scareSurf,(128,440))
scoreSurf2 = basic_font.render("/" + info2, True, (0, 0, 0))
screen.blit(scoreSurf2, (170,440))
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