Commit 6121ed45 by BellCodeEditor

save project

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