Commit 363303f3 by BellCodeEditor

save project

parent b39f9378
Showing with 18 additions and 3 deletions
...@@ -54,8 +54,8 @@ while True: ...@@ -54,8 +54,8 @@ while True:
play_button = stop_img play_button = stop_img
pygame.mixer.music.unpause() pygame.mixer.music.unpause()
else: else:
play_button = play_img
pygame.mixer.music.pause() pygame.mixer.music.pause()
play_button = play_img
if x > 420 and x < 520 and y > 350 and y < 400: # 下一曲 if x > 420 and x < 520 and y > 350 and y < 400: # 下一曲
num += 1 num += 1
if num > len(music_list) - 1: if num > len(music_list) - 1:
...@@ -67,7 +67,9 @@ while True: ...@@ -67,7 +67,9 @@ while True:
click += 2 click += 2
else: else:
click += 1 click += 1
music1=pygame.mixer.sound(path+"\\" + music_list[num])
music_lenght=music1.get_lenght()
music_lenght=int(music_lenght)
if x > 120 and x < 220 and y > 350 and y < 400: # 上一曲 if x > 120 and x < 220 and y > 350 and y < 400: # 上一曲
num -= 1 num -= 1
if num < 0: if num < 0:
...@@ -90,7 +92,15 @@ while True: ...@@ -90,7 +92,15 @@ while True:
play_m=play_time//60 play_m=play_time//60
play_s=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) info=str(play_m)+":"+str(play_s)
music_m=music_lenght//60
music_s=music_lenght%60
if music_s<10:
music_s="0"+str(music_s)
info=str(play_m)+":"+str(play_s)
#+++++ #+++++
#+++++ #+++++
new_logo=pygame.transform.rotate(logo_img,angle) new_logo=pygame.transform.rotate(logo_img,angle)
...@@ -98,7 +108,7 @@ while True: ...@@ -98,7 +108,7 @@ while True:
newRect=new_logo=get_rect(center=(320,200)) newRect=new_logo=get_rect(center=(320,200))
#+++++ #+++++
pos=(newRect[0],new_rect[1]) pos=(newRect[0],new_rect[1])
angle=1 angle+=1
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
...@@ -106,5 +116,9 @@ while True: ...@@ -106,5 +116,9 @@ while True:
screen.blit(logo_img, (170, 60)) # 中间logo图 screen.blit(logo_img, (170, 60)) # 中间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))
scoreSurf2=basic_font.render("/"+info2,Ture,(0,0,0))
screen.blit(scoreSurf2,(170,440))
# 刷新画面 # 刷新画面
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