Commit 6121ed45 by BellCodeEditor

save project

parent 75e14fd5
Showing with 10 additions and 4 deletions
......@@ -14,6 +14,7 @@ logo_img = pygame.image.load('logo.png') # 中间logo
pygame.mixer.music.load("歌曲4.ogg")
pygame.mixer.music.play()
volume=0.2
chick=
pygame.mixer.music.set_volume(volume)
while True:
for event in pygame.event.get():
......@@ -22,13 +23,18 @@ while True:
if event.type == locals.KEYDOWN:
if event.key == locals.K_UP:
volume=+volume+0.1
pygame.mixer.music.set_volume(volume)
if volume>1:
volume=1
pygame.mixer.music.set_volume(volume)
if event.key == locals.K_DOWN:
volume=volume-0.1
pygame.mixer.music.set_volume(volume)
if volume<1:
volume=1
pygame.mixer.music.set_volume(volume)
if
# if pygame.mixer.music.get_busy==False:
# pygame.mixer.music.play()
if pygame.mixer.music.get_busy()==False:
pygame.mixer.music.play()
# 绘制画面
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