Commit 6f4ea99b by BellCodeEditor

save project

parent d0ad0846
Showing with 9 additions and 2 deletions
......@@ -14,13 +14,20 @@ logo_img = pygame.image.load('logo.png') # 中间logo
FPS=pygame.time.Clock()
pygame.mixer.music.load("歌曲4.ogg")
pygame.mixer.music.load("歌曲1.wav")
volume=0.0
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
if event.type == locals.KEYDOWN:
if event.key == locals.K_UP and volume < 1.0:
volume+=0.1
pygame.mixer.music.set_volume(volume)
if event.key ==locals.K_DOWN and volume > 0.0:
volume-=0.1
pygame.mixer.music.set_volume(volume)
if pygame.mixer.music.get_busy() == False:
pygame.mixer.music.play()
# 绘制画面
......
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