Commit 1d951b62 by BellCodeEditor

auto save

parent 24b806a6
Showing with 11 additions and 1 deletions
...@@ -13,12 +13,17 @@ play_img = pygame.image.load('play.png') # 播放按钮 ...@@ -13,12 +13,17 @@ play_img = pygame.image.load('play.png') # 播放按钮
stop_img = pygame.image.load('stop.png') # 暂停按钮 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') # 下一曲按钮
nextclick_img = pygame.image.load('nextclick.png') # 下一曲按钮被点击
logo_img = pygame.image.load('logo.png') # 下一曲按钮 logo_img = pygame.image.load('logo.png') # 下一曲按钮
volume = 0.2 volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量 pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0 click = 0
play_button = stop_img play_button = stop_img
next_botton = next_img
lasttime = 0
now = 0
FPSCLOCK = pygame.time.Clock()
#music_list = ['歌曲1.wav','歌曲2.wav','歌曲3.wav','歌曲4.ogg'] #music_list = ['歌曲1.wav','歌曲2.wav','歌曲3.wav','歌曲4.ogg']
list_number = -1 list_number = -1
...@@ -60,6 +65,7 @@ while True: ...@@ -60,6 +65,7 @@ while True:
click = 0 click = 0
play_button = stop_img play_button = stop_img
if x > 420 and x < 520 and y > 350 and y < 400: if x > 420 and x < 520 and y > 350 and y < 400:
next_botton = nextclick_img
list_number += 1 list_number += 1
if list_number > len(listmusic)-1: if list_number > len(listmusic)-1:
list_number = 0 list_number = 0
...@@ -67,6 +73,7 @@ while True: ...@@ -67,6 +73,7 @@ while True:
pygame.mixer.music.play() pygame.mixer.music.play()
click = 0 click = 0
play_button = stop_img play_button = stop_img
next_botton = next_img
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
listmusic.clear() listmusic.clear()
list_number += 1 list_number += 1
...@@ -84,6 +91,8 @@ while True: ...@@ -84,6 +91,8 @@ while True:
screen.blit(play_button, (270, 330)) # 暂停按钮 screen.blit(play_button, (270, 330)) # 暂停按钮
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_botton, (420, 350)) # 下一曲
# 刷新画面 # 刷新画面
FPSCLOCK.tick(60)
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