Commit 9674f8f1 by BellCodeEditor

save project

parent d105faed
Showing with 12 additions and 2 deletions
...@@ -12,6 +12,7 @@ last_img = pygame.image.load('last.png') # 上一曲按钮 ...@@ -12,6 +12,7 @@ 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 logo_img = pygame.image.load('logo.png') # 中间logo
pygame.mixer.music.load('歌曲4.ogg') pygame.mixer.music.load('歌曲4.ogg')
basic_font=pygame.font.Font("neuropol.ttf",14)
w = [] w = []
qq="C:\\Users\\86130\\Desktop\\text" qq="C:\\Users\\86130\\Desktop\\text"
...@@ -52,6 +53,7 @@ while True: ...@@ -52,6 +53,7 @@ while True:
else: else:
pygame.mixer.music.unpause() pygame.mixer.music.unpause()
b = stop_img b = stop_img
if x>120 and y>350 and x<520 and y>240 and y<400: if x>120 and y>350 and x<520 and y>240 and y<400:
m=m-1 m=m-1
if m<0: if m<0:
...@@ -67,13 +69,21 @@ while True: ...@@ -67,13 +69,21 @@ while True:
pygame.mixer.music.load(qq+"\\"+w[m]) pygame.mixer.music.load(qq+"\\"+w[m])
pygame.mixer.music.play() pygame.mixer.music.play()
new_logo=pygame.transform.rotate(logo_img,angle) new_logo=pygame.transform.rotate(logo_img,angle)
play_time=pygame.mixer.music.get_pos()
play_time=int(play_time/1000)
play_m=play_time//60
play_s=play_time%60
info=str(play_m)+":"+str(play_s)
newRect=new_logo.get_rect(center=(320,200)) newRect=new_logo.get_rect(center=(320,200))
angle+=1 if ades%2==0:
# 绘制画面 angle+=1
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(b, (270, 330)) # 暂停按钮 screen.blit(b, (270, 330)) # 暂停按钮
screen.blit(new_logo, newRect) # 中间logo图 screen.blit(new_logo, newRect) # 中间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,True,(255,255,255))
screen.blit(scoreSurf,(120,440))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
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