Commit 12d099ac by BellCodeEditor

auto save

parent ab33b4c3
Showing with 9 additions and 9 deletions
......@@ -23,15 +23,15 @@ 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:
volume += 0.1
if volume > 1:
volume = 1
if event.key == locals.K_DOWN:
volume -= 0.1
if volume < 0:
volume = 0
if event.type == locals.KEYDOWN:#当出现键盘事件
if event.key == locals.K_UP:#当按下上键
volume += 0.1 #音量+0.1
if volume > 1:#如果音量大于1
volume = 1 #设音量为1
if event.key == locals.K_DOWN:#当按下下键
volume -= 0.1#音量-0.1
if volume < 0:#如果音量小于0
volume = 0#设音量为1
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