Commit 80764c37 by BellCodeEditor

save project

parent 26bac9a2
Showing with 11 additions and 6 deletions
...@@ -13,7 +13,7 @@ next_img = pygame.image.load('next.png') # 下一曲按钮 ...@@ -13,7 +13,7 @@ next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮 logo_img = pygame.image.load('logo.png') # 下一曲按钮
# 载入音乐 # 载入音乐
f=['歌曲1.wav','歌曲2.wav','歌曲3.wav','歌曲4.wav'] f=['歌曲1.wav','歌曲2.wav','歌曲3.wav','歌曲4.ogg']
m=-1 m=-1
volume = 0.2 volume = 0.2
...@@ -51,19 +51,24 @@ while True: ...@@ -51,19 +51,24 @@ while True:
else: else:
play_button = play_img play_button = play_img
pygame.mixer.music.pause() pygame.mixer.music.pause()
if event.button == 1:
x,y = event.pos
if x>120 and x<220 and y>350 and y<400: if x>120 and x<220 and y>350 and y<400:
m -= 1 m -= 1
if m<0: if m<0:
m=len(f)-1 m = len(f) - 1
pygame.mixer.music.load(f[m])
pygame.mixer.music.play()
click += 1
if x>420 and x<520 and y>350 and y<400:
m += 1
if m>len(f) - 1:
m = 0
pygame.mixer.music.load(f[m]) pygame.mixer.music.load(f[m])
pygame.mixer.music.play() pygame.mixer.music.play()
play_button=stop_img click += 1
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
m += 1 m += 1
if m>len(f): if m>len(f)-1:
m=0 m=0
pygame.mixer.music.load(f[m]) pygame.mixer.music.load(f[m])
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