Commit 9be29c39 by BellCodeEditor

save project

parent 05c1206e
Showing with 7 additions and 17 deletions
...@@ -13,6 +13,7 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮 ...@@ -13,6 +13,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') # 下一曲按钮
basic_font=pygame.font.Font('neuropol.ttf',14)
music_list = [] music_list = []
path = "C:\\Users\\EDZ\\Desktop\\text\\" path = "C:\\Users\\EDZ\\Desktop\\text\\"
...@@ -50,11 +51,13 @@ while True: ...@@ -50,11 +51,13 @@ while True:
if x > 270 and x < 370 and y > 350 and y < 450: # 播放按钮 if x > 270 and x < 370 and y > 350 and y < 450: # 播放按钮
click += 1 click += 1
if click % 2 == 0: if click % 2 == 0:
pygame.mixer.music.unpause()
play_button = stop_img play_button = stop_img
else: else:
play_button = play_img play_button = play_img
pygame.mixer.music.pause()
...@@ -87,23 +90,12 @@ while True: ...@@ -87,23 +90,12 @@ while True:
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)
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:
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()
# 绘制画面 # 绘制画面
newloge=pygame.transform.rotate(logo_img,angle) newloge=pygame.transform.rotate(logo_img,angle)
newRect=newloge.get_rect(center=(320,200)) newRect=newloge.get_rect(center=(320,200))
...@@ -116,9 +108,7 @@ while True: ...@@ -116,9 +108,7 @@ 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(into,Ture,(255,255,255)) scoreSurf=basic_font.render(info,True,(255,255,255))
screen.blit(scoreSurf(120,440)) screen.blit(scoreSurf,(120,440))
pygame.display.update() pygame.display.update()
# FPS.tick(60) FPS.tick(60)
\ No newline at end of file \ 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