Commit 745147d0 by BellCodeEditor

save project

parent 4128044d
Showing with 38 additions and 13 deletions
......@@ -12,14 +12,14 @@ last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 中间logo
s=0.55
g=0.55
click=0
f=-1
m=[]
s="C:\\Users\\5\\Desktop\\test"
c=os.listdir(s)
path="C:\\Users\\5\\Desktop\\test"
c=os.listdir(path)
for i in c:
if c[-4:]=='.wav' or c[-4:]=='.ogg':
if i[-4:]==".wav" or i[-4:]==".ogg":
m.append(i)
k=stop_img
while True:
......@@ -28,16 +28,16 @@ while True:
exit()
if event.type==locals.KEYDOWN:
if event.key==locals.K_UP:
s +=0.05
if s>1:
s=1
pygame.mixer.music.set_volume(s)
g +=0.05
if g>1:
g=1
pygame.mixer.music.set_volume(g)
if event.type==locals.KEYDOWN:
if event.key==locals.K_DOWN:
s -=0.05
if s<0:
s=0
pygame.mixer.music.set_volume(s)
g-=0.05
if g<0:
g=0
pygame.mixer.music.set_volume(g)
if event.type==locals.MOUSEBUTTONDOWN:
if event.button==1:
x,y=event.pos
......@@ -52,14 +52,39 @@ while True:
else:
k=play_img
pygame.mixer.music.pause()
if x>120 and x<220 and y>350 and y<450:
f-=1
if f<0:
f=len(m)-1
pygame.mixer.music.load(path+"\\"+m[f])
pygame.mixer.music.play()
if x>420 and x<520 and y>350 and y<450:
f+=1
if f>len(m)-1:
f=0
pygame.mixer.music.load(path+"\\"+m[f])
pygame.mixer.music.play()
if pygame.mixer.music.get_busy()==False:
f+=1
if f>len(m)-1:
f=0
pygame.mixer.music.load(s+ '\\'+m[f])
pygame.mixer.music.load(path+"\\"+m[f])
pygame.mixer.music.play()
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(k, (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