Commit e22d6bc0 by BellCodeEditor

save project

parent 3ad62bb8
Showing with 11 additions and 8 deletions
...@@ -12,7 +12,7 @@ last_img = pygame.image.load('last.png') # 上一曲按钮 ...@@ -12,7 +12,7 @@ last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮 next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 中间logo logo_img = pygame.image.load('logo.png') # 中间logo
pygame.mixer.music.load(歌曲4.ogg) pygame.mixer.music.load('歌曲4.ogg')
v = 0.8 v = 0.8
pygame.mixer.music.set_volume(v) pygame.mixer.music.set_volume(v)
c = 0 c = 0
...@@ -36,13 +36,16 @@ while True: ...@@ -36,13 +36,16 @@ while True:
if v>0: if v>0:
v=0 v=0
if event.type==locals.MOUSEBUTTONDOWN: if event.type==locals.MOUSEBUTTONDOWN:
c+=1 if event.button == 1:
if c%2==0: x,y=event.pos
p=stop_img if x>270 and x<370 and y>350 and y<450:
pygame.mixer.music.unpause() c+=1
else: if c%2==0:
p=play_img p=stop_img
pygame.mixer.music.pause() pygame.mixer.music.unpause()
else:
p=play_img
pygame.mixer.music.pause()
if pygame.mixer.music.get_busy()==False: if pygame.mixer.music.get_busy()==False:
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