Commit 12d099ac by BellCodeEditor

auto save

parent ab33b4c3
Showing with 10 additions and 10 deletions
...@@ -23,18 +23,18 @@ while True: ...@@ -23,18 +23,18 @@ while True:
for event in pygame.event.get(): #生成所有事件 for event in pygame.event.get(): #生成所有事件
if event.type == locals.QUIT: #当点击退出键 if event.type == locals.QUIT: #当点击退出键
exit() #退出 exit() #退出
if event.type == locals.KEYDOWN: if event.type == locals.KEYDOWN:#当出现键盘事件
if event.key == locals.K_UP: if event.key == locals.K_UP:#当按下上键
volume += 0.1 volume += 0.1 #音量+0.1
if volume > 1: if volume > 1:#如果音量大于1
volume = 1 volume = 1 #设音量为1
if event.key == locals.K_DOWN: if event.key == locals.K_DOWN:#当按下下键
volume -= 0.1 volume -= 0.1#音量-0.1
if volume < 0: if volume < 0:#如果音量小于0
volume = 0 volume = 0#设音量为1
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