Commit ef32299c by BellCodeEditor

save project

parent 6889f7fb
Showing with 11 additions and 14 deletions
...@@ -8,7 +8,7 @@ stop_img = pygame.image.load('stop.png') ...@@ -8,7 +8,7 @@ stop_img = pygame.image.load('stop.png')
last_img = pygame.image.load('last.png') 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_img = pygame.image.load('logo.png')
pygame.mixer_music.load('歌曲1.wav') pygame.mixer_music.load('歌曲3.wav')
volume=0.2 volume=0.2
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
click=0 click=0
...@@ -18,19 +18,16 @@ while True: ...@@ -18,19 +18,16 @@ while True:
if event.type==locals.QUIT: if event.type==locals.QUIT:
exit() exit()
if event.type == locals.KEYDOWN: if event.type == locals.KEYDOWN:
if evant.key == locals.K_UP: if event.button==1:
volume += 0.2 x,y=event.pos
if volume<0: if x>270 and x<370 and y>350 and y<450:
volume=0 click+=1
pygame.mixer.music_volume(volume) if click%2==0:
if event.type == locals.MOUSEBUTTONDOWN: play_button=stop_img
click+=1 pygame.mixer.music.unpause()
if click%2==0: else:
play_button=stop_img play_button=play_img
pygame.mixer.music.unpause() pygame.mixer.music.pause()
else:
play_button=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()
screen.blit(bg_img, (0, 0)) screen.blit(bg_img, (0, 0))
......
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