Commit cb2428a8 by BellCodeEditor

save project

parent 07b208db
Showing with 30 additions and 2 deletions
...@@ -84,7 +84,10 @@ while True: ...@@ -84,7 +84,10 @@ while True:
pygame.mixer.music.play() pygame.mixer.music.play()
click = 0 click = 0
play_button = stop_img play_button = stop_img
music1 = pygame.mixer.Sound(path + "\\" + music_list[num])
music_lenth = music1.get_lenth()
music_lenth = int(music_lenth)
if x > 420 and x < 520 and y > 350 and y < 400: if x > 420 and x < 520 and y > 350 and y < 400:
num -= 1 num -= 1
...@@ -95,19 +98,43 @@ while True: ...@@ -95,19 +98,43 @@ while True:
click = 0 click = 0
play_button = stop_img play_button = stop_img
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
num += 1 num += 1
if num > len(music_list)-1: if num > len(music_list)-1:
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()
music1 = pygame.mixer.Sound(path + "\\" + music_list[num])
music_lenth = music1.get_lenth()
music_lenth = int(music_lenth)
play_time = pygame.mixer.music.get_pos()
play_time = int(play_time/1000)
music_m = music_lenth//60
music_s = music_lenth%60
if play_s <10:
play_s = "0"+str(play_s)
info2 =str(music_m)+ ":" + str(music_s)
play_m = play_time//60
play_s = play_time%60
if music_s <10:
music_s = "0"+str(music_s)
info =str(play_m)+ ":" + str(play_s)
new_logo = pygame.transform.rotate(logo_img, angle) new_logo = pygame.transform.rotate(logo_img, angle)
newRect = (newRect[0], newRect[1]) newRect = (newRect[0], newRect[1])
pos = (newRect[0], newRect[1]) pos = (newRect[0], newRect[1])
angle += 1 angle += 1
text = my_font.render(info,True,(0,0,0))
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(logo_img, (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))
screen.blit(text,(100,360))
text2 = my_font.render("/"info2,True,(0,0,0))
screen.blit(text2,(150,360))
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