Commit a0567b0c by BellCodeEditor

save project

parent 9900e2a0
Showing with 14 additions and 5 deletions
......@@ -12,7 +12,7 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮
font = pygame.font.Font('neuropol.ttf',20)
music_list = []
path = r"C:\Users\aki\Desktop"
filelist = os.listdir(path)
......@@ -64,7 +64,7 @@ while True:
click += 2
else:
click += 1
if x > 120 and x < 220 and y > 350 and y < 400:
num -= 1
if num < 0:
......@@ -83,16 +83,24 @@ while True:
num = 0
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
music1 = pygame.mixer.Sound(path + "\\" + music_list[num])
new_logo = pygame.transform.rotate(logo_img, angle)
new_rect = new_logo.get_rect(center = (320,200))
logo_x,logo_y = (new_rect[0],new_rect[1])
if play_button == stop_img:
angle += 1
angle += 1
time = pygame.mixer.music.get_pos()
play_time = int(time//1000)
play_time_m = play_time//60
play_time_s = play_time%60
time_text = str(play_time_m) + ":" + str(play_time_s)
text = font.render(time_text,True,(255,255,255))
screen.blit(bg_img, (0, 0))
screen.blit(play_button, (270, 330))
screen.blit(new_logo, (logo_x, logo_y))
screen.blit(last_img, (120, 350))
screen.blit(next_img, (420, 350))
screen.blit(text,(300,200))
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