Commit a05de126 by BellCodeEditor

save project

parent df6e3949
Showing with 41 additions and 6 deletions
......@@ -22,7 +22,7 @@ volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0
play_button = stop_img
o=-1
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -40,9 +40,12 @@ while True:
volume = 0
pygame.mixer.music.set_volume(volume)
# 按下鼠标
if event.type == locals.MOUSEBUTTONDOWN:
# 次数增加
if event.button==1:
x,y=event.pos
if x > 270 and x < 370 and y > 350 and y < 450: # 次数增加
click += 1
if click % 2 == 0:
play_button = stop_img
......@@ -50,11 +53,29 @@ while True:
else:
play_button = play_img
pygame.mixer.music.pause()
if pygame.mixer.music.get_besy()==False:
o+=1
if o>len(music_list)-1 :
o==0
if x > 120 and x < 220 and y >350 and y < 400:
num-=1
if num<0:
num =len(music_list)-1
pygame.mixer.music.load(path+"\\"+music_list[num])
pygame.mixer.music.play()
play_button =stop_img
click = 0
if x>420 and x <520 and y > 350 and y < 400:
num+=1
if num > len(music_list)_1:
num=0
pygame.mixer.music.load(path+"\\"+music_list[num])
pygame.mixer.music.play()
play_buttom=stop_img
click=0
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()
# 绘制画面
......@@ -65,3 +86,17 @@ while True:
screen.blit(next_img, (420, 350)) # 下一曲
# 刷新画面
pygame.display.update()
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