Commit de0bb2c3 by BellCodeEditor

save project

parent c4a91d4a
Showing with 9 additions and 8 deletions
......@@ -14,7 +14,7 @@ next_img = pygame.image.load('next.png') # 背景图
logo_img = pygame.image.load('logo.png')
music_list = []
path = "C:\Users\admin\Documents\pygame_lesson4_diy3"
path = "C:\\Users\\admin\\Documents\\pygame_lesson4_diy3"
filelist = os.listdir(path)
for i in filelist:
if i[-4:] == ".ogg" or i[-4:] == ".wav":
......@@ -23,8 +23,8 @@ for i in filelist:
num = -1
volume=0.6
pygame.mixer.music.set_volume(volume)
c=0
stop=stop_img
click = 0
play_button = stop_img
while True:
for event in pygame.event.get():
......@@ -50,16 +50,17 @@ while True:
stop=play_img
pygame.mixer.music.pause()
if pygame.mixer.music.get_busy() == False:
num += 1
if num > len(filelist)-1:
num = 0
print(num)
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
# 绘制画面
screen.blit(bg_img, (0, 0))
screen.blit(stop, (270, 330))
screen.blit(play_button, (270, 330))
screen.blit(logo_img, (170, 60))
screen.blit(last_img, (120, 350))
screen.blit(next_img, (420, 350)) # 填充背景
......
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