Commit e52289fa by BellCodeEditor

save project

parent 4f5f2456
Showing with 16 additions and 1 deletions
......@@ -12,6 +12,7 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮
basic_font=pygame.font.Font('neuropol.ttf',14)
FPS=pygame.time.Clock()
music_list = []
path = "C:\\Users\\2\\Desktop\\text"
......@@ -57,6 +58,8 @@ while True:
num += 1
if num > len(music_list) - 1:
num = 0
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
play_button = stop_img
......@@ -77,6 +80,13 @@ while True:
else:
click += 1
play_time=pygame.mixer.music.get_pos()
play_time=
play_m=play_time//60
play_s=play_time%60
info=str(play_m)+':'+str(play_s)
if pygame.mixer.music.get_busy() == False:
num += 1
if num > len(music_list)-1:
......@@ -85,15 +95,20 @@ while True:
pygame.mixer.music.play()
new_logo = pygame.transform.rotate(logo_img,angle)
newRect = new_logo.get_rect(center =(320, 200))
print(newRect)
pos = (newRect[0],newRect[1])
if play_button == stop_img:
angle+=1
# 绘制画面
scoreSurf=basic_font.render(info,True,(255,255,255))
screen.blit(scoreSurf,(120,440))
scoreSurf2=basic_font.render('/'+info2,True,(0,0,0))
screen.blit(scoreSurf,(120,440))
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮
screen.blit(logo_img, pos) # 中间logo图
......
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