Commit b29e35dd by BellCodeEditor

save project

parent 381f526c
Showing with 12 additions and 5 deletions
...@@ -12,7 +12,7 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮 ...@@ -12,7 +12,7 @@ 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') # 下一曲按钮
Zi_Ti = pygame.font.Font("neuropol.ttf",20)
music_list = ["歌曲1.wav","歌曲2.wav","歌曲3.wav","歌曲4.ogg"] music_list = ["歌曲1.wav","歌曲2.wav","歌曲3.wav","歌曲4.ogg"]
num = -1 num = -1
...@@ -75,7 +75,12 @@ while True: ...@@ -75,7 +75,12 @@ while True:
click += 2 click += 2
else: else:
click += 1 click += 1
pygame_time = pygame.mixer.music.get_pos()
pygame_time_s=pygame_time//1000
pygame_time_w=pygame_time_s//60&60
pygame_time_s=str(pygame_time_s)
pygame_time_w=str(pygame_time_w)
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
num += 1 num += 1
if num > len(music_list)-1: if num > len(music_list)-1:
...@@ -85,15 +90,16 @@ while True: ...@@ -85,15 +90,16 @@ while True:
if Zhuan_Dong == 0: if Zhuan_Dong == 0:
new_logo = pygame.transform.rotate(logo_img,Xuan_Zhuan) new_logo = pygame.transform.rotate(logo_img,Xuan_Zhuan)
new_xy = new_logo.get_rect(center=(320,200)) new_xy = new_logo.get_rect(center=(320,200))
Xuan_Zhuan += 1
xy = (new_xy[0],new_xy[1]) xy = (new_xy[0],new_xy[1])
my=Zi_Ti.render(pygame_time_w+":"+pygame_time_s,True,(0,0,0))
Xuan_Zhuan += 1
# 绘制画面c # 绘制画面c
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮 screen.blit(play_button, (270, 330)) # 暂停按钮
screen.blit(new_logo, xy) # 中间logo图 screen.blit(new_logo, xy) # 中间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))
screen.blit(my, (120, 435)) # 下一曲
# 刷新画面 # 刷新画面
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