Commit 91722555 by BellCodeEditor

save project

parent 2199b114
Showing with 17 additions and 3 deletions
......@@ -13,13 +13,27 @@ next_img = pygame.image.load('next.png')
logo_img = pygame.image.load('logo.png')
pygame.mixer.music.load('歌曲4.ogg')
volume = 0.8
pygame.mixer.music.set_volume(volume)
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
if pygame.mixer.music.get_busy() == False:
pygame.mixer.music.play()
if event.type == locals.KEYDOWN:
if event.key == locals.K_UP:
volume += 0.1
if volume < 0 or volume==0:
volume = 0
pygame.mixer.music.set_volume(volume)
if event.key == locals.K_DOWN:
volume -= 0.1
if volume < 0 or volume==0:
volume = 0
pygame.mixer.music.set_volume(volume)
if pygame.mixer.music.get_busy() == False:
pygame.mixer.music.play()
screen.blit(bg_img, (0, 0))
screen.blit(stop_img, (270, 330))
screen.blit(logo_img, (170, 60))
......
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