Commit 4f5cfdd3 by BellCodeEditor

auto save

parent cf1fb35a
Showing with 11 additions and 4 deletions
...@@ -12,10 +12,13 @@ last_img = pygame.image.load('last.png') # 上一曲按钮 ...@@ -12,10 +12,13 @@ last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮 next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮 logo_img = pygame.image.load('logo.png') # 下一曲按钮
# 载入音乐 aa = ['歌曲1.wav','歌曲2.wav','歌曲3.wav','歌曲4.ogg',]# 载入音乐
pygame.mixer.music.load('歌曲4.ogg') # 载入音乐 a=-1
while True:
# 载入音乐
volume = 0.2 volume =3
pygame.mixer.music.set_volume(volume) # 初始播放音量 pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0 click = 0
play_button = stop_img play_button = stop_img
...@@ -52,8 +55,12 @@ while True: ...@@ -52,8 +55,12 @@ while True:
pygame.mixer.music.pause() pygame.mixer.music.pause()
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
a+=1
if a>len(aa)-1:
a=0
pygame.mixer.music.load(aa[a])
pygame.mixer.music.play() pygame.mixer.music.play()
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮 screen.blit(play_button, (270, 330)) # 暂停按钮
......
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