Commit 7de95a52 by BellCodeEditor

auto save

parent c71ff7b1
Showing with 5 additions and 4 deletions
...@@ -11,10 +11,10 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮 ...@@ -11,10 +11,10 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮 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') # 下一曲按钮
# 载入音乐
list=["frog.mp3","歌曲1.wav"] list=["frog.mp3","歌曲1.wav"]
i=0 i=0
# 载入音乐
volume = 0.5 volume = 0.5
pygame.mixer.music.set_volume(volume) # 初始播放音量 pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0 click = 0
...@@ -50,13 +50,14 @@ while True: ...@@ -50,13 +50,14 @@ while True:
else: else:
play_button = play_img play_button = play_img
pygame.mixer.music.pause() pygame.mixer.music.pause()
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
# 载入音乐
if i>len(list)-1: if i>len(list)-1:
i=0 i=0
pygame.mixer.music.load(list[i]) pygame.mixer.music.load(list[i]) # 载入音乐
pygame.mixer.music.play() pygame.mixer.music.play()
i+=1 i+=1
# 绘制画面 # 绘制画面
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