Commit 48e67a9b by BellCodeEditor

auto save

parent 349f0c91
Showing with 10 additions and 2 deletions
...@@ -14,7 +14,7 @@ next_img = pygame.image.load('next.png') # 下一曲按钮 ...@@ -14,7 +14,7 @@ next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮 logo_img = pygame.image.load('logo.png') # 下一曲按钮
music_list = [] music_list = []
path = "C:\\Users\\Administrator\\Desktop\\tast" path = "C:\\Users\\EDY\\Desktop\\test"
filelist = os.listdir(path) filelist = os.listdir(path)
num = -1 num = -1
for i in filelist: for i in filelist:
...@@ -64,6 +64,9 @@ while True: ...@@ -64,6 +64,9 @@ while True:
click += 2 click += 2
else: else:
click += 1 click += 1
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
play_button = stop_img
if x > 120 and x < 220 and y > 350 and y < 400: if x > 120 and x < 220 and y > 350 and y < 400:
num -= 1 num -= 1
...@@ -76,6 +79,9 @@ while True: ...@@ -76,6 +79,9 @@ while True:
click += 2 click += 2
else: else:
click += 1 click += 1
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
play_button = stop_img
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
num += 1 num += 1
...@@ -83,11 +89,13 @@ while True: ...@@ -83,11 +89,13 @@ while True:
num = 0 num = 0
pygame.mixer.music.load(path + "\\" + music_list[num]) pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
# 唱盘
new_logo = pygame.transform.rotate(logo_img, angle) new_logo = pygame.transform.rotate(logo_img, angle)
angle += 1 angle += 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))
screen.blit(logo_img, (170, 60)) screen.blit(new_logo, (170, 60))
screen.blit(last_img, (120, 350)) screen.blit(last_img, (120, 350))
screen.blit(next_img, (420, 350)) screen.blit(next_img, (420, 350))
......
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