Commit 681df1c4 by BellCodeEditor

save project

parent 0415c7a7
Showing with 10 additions and 6 deletions
import pygame
from pygame import locals
import os
pygame.init() # 初始化
# 创建窗口
screen = pygame.display.set_mode((640, 480))
......@@ -14,9 +15,12 @@ logo_img = pygame.image.load('logo.png') # 下一曲按钮
num=-1
p=[]
zppp=
# 载入音乐
pp='C:\\Users\\Think\\Desktop\\nb'
ppp=os.listdir(pp)
for pppp in ppp:
if pppp[-4:]==".wav" or pppp[-4:]==".ogg":
p.insert(0,pppp)
volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量
......@@ -59,18 +63,18 @@ while True:
pygame.mixer.music.pause()
if pygame.mixer.music.get_busy() == False:
if
num+=1
if num<len(p)-1:
pygame.mixer.music.load(p[num])
pygame.mixer.music.load(ppp+"\\"+p[num])
pygame.mixer.music.play()
if num==len(p)-1:
num=0
pygame.mixer.music.load(p[num])
pygame.mixer.music.load(ppp+"\\"+p[num])
pygame.mixer.music.play()
# 绘制画面
......
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