Commit 6ea5457e by BellCodeEditor

save project

parent deb54807
Showing with 13 additions and 2 deletions
...@@ -10,6 +10,9 @@ next_img = pygame.image.load('next.png') ...@@ -10,6 +10,9 @@ 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('歌曲1.wav')
volume=0.2 volume=0.2
pygame.mixer.music.set_volume(volume)
click=0
play_button = stop_img
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type==locals.QUIT: if event.type==locals.QUIT:
...@@ -20,11 +23,19 @@ while True: ...@@ -20,11 +23,19 @@ while True:
if volume<0: if volume<0:
volume=0 volume=0
pygame.mixer.music_volume(volume) pygame.mixer.music_volume(volume)
if event.type == locals.MOUSEBUTTONDOWN:
click+=1
if click%2==0:
play_button=stop_img
pygame.mixer.music.unpause()
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))
screen.blit(stop_img, (270, 330)) screen.blit(play_button, (270, 330))
screen.blit(logo_img, (170, 60)) screen.blit(logo_img, (170, 60))
screen.blit(last_img, (120, 350)) screen.blit(last_img, (120, 350))
screen.blit(next_img, (420, 350)) screen.blit(next_img, (420, 350))
pygame.display.undate() 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