Commit aa7ffaba by BellCodeEditor

auto save

parent f0fff348
Showing with 23 additions and 2 deletions
...@@ -12,11 +12,14 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮 ...@@ -12,11 +12,14 @@ 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 logo_img = pygame.image.load('logo.png') # 中间logo
font=pygame.font.Font("neuropol.ttf",18)
# pygame.mixer.music.load('xuanni.ogg') #载入音乐 # pygame.mixer.music.load('xuanni.ogg') #载入音乐
# pygame.mixer.music.load('wuli.ogg') #载入音乐 # pygame.mixer.music.load('wuli.ogg') #载入音乐
volume=0.2 volume=0.2
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
click=0 click=0
angle=0
a=0
play_button=stop_img play_button=stop_img
num=-1 num=-1
music_list=[] music_list=[]
...@@ -54,9 +57,12 @@ while True: ...@@ -54,9 +57,12 @@ while True:
if click%2==0: if click%2==0:
pygame.mixer.music.unpause() pygame.mixer.music.unpause()
play_button=stop_img play_button=stop_img
a=0
else: else:
pygame.mixer.music.pause() pygame.mixer.music.pause()
play_button=play_img play_button=play_img
a=1
if x>120 and x<220 and y>350 and y<450: if x>120 and x<220 and y>350 and y<450:
num-=1 num-=1
if num<0: if num<0:
...@@ -73,11 +79,25 @@ while True: ...@@ -73,11 +79,25 @@ while True:
pygame.mixer.music.play() pygame.mixer.music.play()
click=0 click=0
play_button=stop_img play_button=stop_img
play_timg=pygame.mixer.music.get_pos()
play_timg=int(play_timg/1000)
play_m=play_timg//60
play_s=play_timg%60
info=str(play_m)+":"+str(play_s)
text=font.render(info,True,(0,0,0))
# 绘制画面 # 绘制画面
new_logo=pygame.transform.rotate(logo_img,angle)
nweRect=new_logo.get_rect(center=(320,200))
pos=(nweRect[0],nweRect[1])
if a==0:
angle+=0.5
else:
angle+=0
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(logo_img, (170, 60)) # 中间logo图 screen.blit(new_logo, pos) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲 screen.blit(last_img, (120, 350))
screen.blit(text, (120, 410)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲 screen.blit(next_img, (420, 350)) # 下一曲
# 刷新画面 # 刷新画面
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