Commit 8adc7121 by BellCodeEditor

auto save

parent 24eb35b0
Showing with 5 additions and 16 deletions
...@@ -15,7 +15,7 @@ pygame.mixer.music.load("歌曲4.ogg") ...@@ -15,7 +15,7 @@ pygame.mixer.music.load("歌曲4.ogg")
volume=0 volume=0
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
click=0
play_button=stop_img play_button=stop_img
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -27,20 +27,7 @@ while True: ...@@ -27,20 +27,7 @@ while True:
if volume>1: if volume>1:
volume=1 volume=1
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
if event.type==locals.KEYUP:
if event.key==locals.K_DOWN:
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:
pygame.mixer.music.unpause()
play_button=stop_img
else:
pygame.mixer.music.pause()
play_button=play_img
if pygame.mixer.music.get_busy()==False: if pygame.mixer.music.get_busy()==False:
pygame.mixer.music.play() pygame.mixer.music.play()
# 绘制画面 # 绘制画面
...@@ -49,4 +36,5 @@ while True: ...@@ -49,4 +36,5 @@ while True:
screen.blit(logo_img, (170, 60)) # 中间logo图 screen.blit(logo_img, (170, 60)) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲 screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲 screen.blit(next_img, (420, 350)) # 下一曲
pygame.display.update() # 刷新画面
pygame.display.update()
\ No newline at end of file
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