Commit 70dad8ad by BellCodeEditor

save project

parent f1c21f3e
Showing with 10 additions and 1 deletions
......@@ -18,12 +18,12 @@ filllist=os.listdir(path)
for i in filllist:
if filllist[-4:]==".wav" or ".ogg":
music.append(i)
print(music)
volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0
play_button = stop_img
num=-1
num1=0
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -53,6 +53,14 @@ while True:
else:
play_button = play_img
pygame.mixer.music.pause()
if x>120 and x<220 and y>350 and y<400:
num1-=1
if num1<0:
num1=len(music)-1
pygame.mixer.music.load(path+"\\"+music[num1])
click=0
play_button=stop_img
pygame.mixer.music.play()
if pygame.mixer.music.get_busy() == False:
num+=1
......@@ -61,6 +69,7 @@ while True:
pygame.mixer.music.load(path+"\\"+music[num])
pygame.mixer.music.play()
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (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