Commit 8a4032fd by BellCodeEditor

save project

parent 7dddac0b
...@@ -12,6 +12,9 @@ last_img = pygame.image.load('last.png') # 上一曲按钮 ...@@ -12,6 +12,9 @@ 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')
pygame.mixer.music.load('歌曲3.wav')
pygame.mixer.music.load('歌曲2.wav')
pygame.mixer.music.load('歌曲1.wav')
# while True: # while True:
...@@ -20,7 +23,10 @@ pygame.mixer.music.load('歌曲4.ogg') ...@@ -20,7 +23,10 @@ pygame.mixer.music.load('歌曲4.ogg')
# exit() # exit()
volume = 0.2 volume = 0.2
# pygame.mixer.music.set_volume(volume) # pygame.mixer.music.set_volume(volume)
filelist=[while expression:
pass
else:
pass]
start = stop_img start = stop_img
click = 0 click = 0
while True: while True:
...@@ -40,7 +46,8 @@ while True: ...@@ -40,7 +46,8 @@ while True:
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
if event.type == locals.MOUSEBUTTONDOWN: if event.type == locals.MOUSEBUTTONDOWN:
if event.button==1: if event.button==1:
] x,y=event.pos
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() pygame.mixer.music.unpause()
...@@ -48,13 +55,16 @@ while True: ...@@ -48,13 +55,16 @@ while True:
else: else:
pygame.mixer.music.pause() pygame.mixer.music.pause()
start = play_img start = play_img
if pygame.mixer.gat_busy()==False:
# if volume <=0: num+=1
if num>len(filelist)-1:
num=0
pygame.mixer.music.load(filelist[num])
pygame.mixer.music.play()
if volume <=0:
# volume = 0 # volume = 0
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
pygame.mixer.music.play() pygame.mixer.music.play()
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(start, (270, 330)) # 暂停按钮 screen.blit(start, (270, 330)) # 暂停按钮
......
import os
files=os.listdir('C:\\Users\\HW\\Desktop\\test')
print(files)
\ 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