Commit 1fbacccc by BellCodeEditor

auto save

parent d832c4ae
Showing with 2 additions and 24 deletions
......@@ -16,29 +16,7 @@ volume=0.1
pygame.mixer.music.set_volume(volume)
while True:
for event in pygame.event.get():
if event.type==locals.QUIT:
exit()
if event.type==locals.KEYDOWN:
if event.key==locals.K_w:
volume+=0.1
if volume>1:
volume=1
pygame.mixer.music.set_volume(volume)
if event.key==locals.K_s:
volume-=0.1
if volume<0:
volume=0
pygame.mixer.music.set_volume(volume)
if event.type==locals.MOUSEBUTTONDOWN:
click+=1
if click%2==0:
play_button=stop_img
pygame.mixer.music.unpause()
else:
play_button=play_img
pygame.mixer.music.pause()
if pygame.mixer.music.get_busy()==False:
pygame.mixer.music.play()
??#点击关闭按钮,程序结束
......@@ -49,4 +27,4 @@ while True:
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
# 刷新画面
pygame.display.update()
??
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