Commit cf347084 by BellCodeEditor

save project

parent f5ba1ac1
Showing with 15 additions and 6 deletions
...@@ -38,19 +38,28 @@ while True: ...@@ -38,19 +38,28 @@ while True:
pygame.mixer_music.set_volume(volume) pygame.mixer_music.set_volume(volume)
if event.type == locals.MOUSEBUTTONDOWN: if event.type == locals.MOUSEBUTTONDOWN:
if event.button == 1: if event.button == 1:
x,y = event.pos x,y = event.pos
if x>270 and x<370 and y>350 and y<450: if x>270 and x<370 and y>350 and y<450:
click += 1 click += 1
if click % 2 == 0: if click % 2 == 0:
play_button = stop_img play_button = stop_img
pygame.mixer.music.unpause() pygame.mixer.music.unpause()
else: else:
play_button = stop_img play_button = stop_img
pygame.mixer.music.unpause() pygame.mixer.music.unpause()
if x > 420 and x < 520 and y > 350 and y < 400:
num -= 1
if num <0:
num = len(music_list)-1
pygame.mixer_music.load(music_list[num])
pygame.mixer_music.play()
chick = 0
play_button = stop_img
if pygame.mixer_music.get_busy()==False: if pygame.mixer_music.get_busy()==False:
num+=1 num+=1
if num > len(filelist)-1: if num > len(filelist)-1:
num=0 num = 0
pygame.mixer.music.load(filelist[num]) pygame.mixer.music.load(filelist[num])
pygame.mixer_music.play() 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