Commit dac5c863 by BellCodeEditor

save project

parent 635bc6d2
Showing with 10 additions and 5 deletions
...@@ -12,16 +12,17 @@ last_img = pygame.image.load('last.png') # 上一曲按钮 ...@@ -12,16 +12,17 @@ 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
music_list=[] music_list=[]
path='C:\\Users\\HP\\Desktop\\text'
filelist=os.listdir(path)
for i in filelist:
if i[-4:]=='.wav' or i[-4:]=='.ogg':
music_list.append(i)
num=-1 num=-1
volume=0.1 volume=0.1
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
click=0 click=0
play_button=stop_img play_button=stop_img
path='C:\\Users\\HP\\Desktop\\text'
filelist=os.listdir(path)
for i in filelist:
if i[-4:]=='.wav' or i[-4:]=='.ogg':
music_list.append(i)
angle=0
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -66,6 +67,10 @@ while True: ...@@ -66,6 +67,10 @@ 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()
new_logo=pygame.transform.rotate(logo_img,angle)
new_SB=new_logo,get_rect(center=(320,200))
pos=(new_SB[0],new_SB[1])
angle+=1
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(stop_img, (270, 330)) # 暂停按钮 screen.blit(stop_img, (270, 330)) # 暂停按钮
......
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