Commit 41d8acda by BellCodeEditor

save project

parent 3677df54
Showing with 23 additions and 5 deletions
...@@ -60,10 +60,12 @@ while True: ...@@ -60,10 +60,12 @@ while True:
pygame.mixer.music.load(path + "\\" + music_list[num]) pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
play_button = stop_img play_button = stop_img
click=0
if click % 2 == 0: if click % 2 == 0:
click += 2 click += 2
else: music1=pygame.mixer.mixer.Sound(path + "\\" + music_list[num])
click += 1 music_length=music1.get_length()
music_length=int(music_length)
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
...@@ -74,8 +76,9 @@ while True: ...@@ -74,8 +76,9 @@ while True:
play_button = stop_img play_button = stop_img
if click % 2 == 0: if click % 2 == 0:
click += 2 click += 2
else: music1=pygame.mixer.mixer.Sound(path + "\\" + music_list[num])
click += 1 music_length=music1.get_length()
music_length=int(music_length)
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
num += 1 num += 1
...@@ -83,13 +86,25 @@ while True: ...@@ -83,13 +86,25 @@ while True:
num = 0 num = 0
pygame.mixer.music.load(path + "\\" + music_list[num]) pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
music1=pygame.mixer.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=pygame.mixer.music.get_pos()
play_time=int(play_time/1000) play_time=int(play_time/1000)
play_m=play_time//60 play_m=play_time//60
play_s=play_time%60 play_s=play_time%60
info=str(play_m)+":"+str(play_s) info=str(play_m)+":"+str(play_s)
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)
new_logo=pygame.transform.rotate(logo_img,angle) new_logo=pygame.transform.rotate(logo_img,angle)
nwRect=new_logo.get_rect(center=(320,200)) nwRect=new_logo.get_rect(center=(320,200))
pos=(nwRect[0],nwRect[1]) pos=(nwRect[0],nwRect[1])
...@@ -102,4 +117,6 @@ while True: ...@@ -102,4 +117,6 @@ while True:
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,True,(255,255,255))
sco
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