Commit 20852428 by BellCodeEditor

auto save

parent 89710a3c
Showing with 0 additions and 38 deletions
...@@ -82,26 +82,6 @@ while True: ...@@ -82,26 +82,6 @@ while True:
music_length = music1.get_length() music_length = music1.get_length()
music_length = int(music_length) music_length = int(music_length)
if pygame.mixer.music.get_busy() == False:
num += 1
if num > len(music_list)-1:
num = 0
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
# 歌曲的时间
music1 = pygame.mixer.Sound(path + "\\" + music_list[num])
music_length = music1.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)
# 歌曲的时间长度 # 歌曲的时间长度
music_m = music_length//60 music_m = music_length//60
...@@ -110,24 +90,6 @@ while True: ...@@ -110,24 +90,6 @@ while True:
music_s = "0"+str(music_s) music_s = "0"+str(music_s)
info2 = str(music_m)+":"+str(music_s) info2 = str(music_m)+":"+str(music_s)
# 旋转图片(注意:这里要搞一个新变量,存储旋转后的图片)
new_logo = pygame.transform.rotate(logo_img, angle)
# 校正旋转图片的中心点
newRect = new_logo.get_rect(center=(320, 200))
# print(newRect) # rect(170, 65, 300, 270) 左上角坐标、图片大小
pos = (newRect[0], newRect[1])
# if判断是否为暂停按钮
if play_button == stop_img:
angle += 1
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮
screen.blit(new_logo, pos) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
# 绘制时间进度
scoreSurf = basic_font.render(info, True, (255, 255, 255))
screen.blit(scoreSurf, (120,440))
scoreSurf2 = basic_font.render("/" + info2, True, (0, 0, 0)) scoreSurf2 = basic_font.render("/" + info2, True, (0, 0, 0))
screen.blit(scoreSurf2, (170,440)) screen.blit(scoreSurf2, (170,440))
# 刷新画面 # 刷新画面
......
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