Commit fc8197cc by BellCodeEditor

auto save

parent 52093124
Showing with 11 additions and 5 deletions
......@@ -30,11 +30,10 @@ while True:
if event.type == locals.KEYDOWN:
if event.key == locals.K_UP:
volume += 0.1
if volume > 1:
volume = 1
volume = 1
pygame.mixer.music.set_volume(volume)
if event.key == locals.K_DOWN:
volume -= 0.1
volume -= 0.1
if volume < 0:
volume = 0
pygame.mixer.music.set_volume(volume)
......@@ -55,9 +54,14 @@ while True:
num += 1
if num > len(music_list)-1:
num = 0
pygame.mixer.music.load(music_list[num])
pygame.mixer.music.load(path+"\\"+music_list[num])
pygame.mixer.music.play()
if pygame.mixer.music.get_busy() == False:
num += 1
if num > len(music_list)-1:
num = 0
pygame.mixer.music.load(path+"\\"+music_list[num])
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮
......@@ -66,3 +70,4 @@ while True:
screen.blit(next_img, (420, 350)) # 下一曲
# 刷新画面
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