Commit a2f7d3f5 by BellCodeEditor

save project

parent 349f0c91
Showing with 30 additions and 1 deletions
...@@ -42,6 +42,7 @@ while True: ...@@ -42,6 +42,7 @@ while True:
volume = 0 volume = 0
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
if event.type == locals.MOUSEBUTTONDOWN: if event.type == locals.MOUSEBUTTONDOWN:
if event.button == 1: if event.button == 1:
x, y = event.pos x, y = event.pos
...@@ -53,6 +54,10 @@ while True: ...@@ -53,6 +54,10 @@ while True:
else: else:
play_button = play_img play_button = play_img
pygame.mixer.music.pause() pygame.mixer.music.pause()
music1 = pygame.mixer.Sound(path + "\\" + music_list[])
music_length = music1.get_length()
music_length = int(music_length)
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
if num > len(music_list) - 1: if num > len(music_list) - 1:
...@@ -83,6 +88,25 @@ while True: ...@@ -83,6 +88,25 @@ 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()
music1 = pygame.mixer.Sound(path + "\\" + music_list[])
music_length = music1.get_length()
music_length = int(music_length)
play_time = pygame.mixer.music.get_pos()
play_time = int(play_time/1000)
play_m = play_time//60
play_s = play_time%60
if play_s < 10
play_s = "0"+str(play_s)
info = str(play_m) + ":" + str(play_s)
text = my_font.render(info,True,(0,0,0))
music_m = music_length//60
music_s = music_length%60
if music_s < 10
music_s = "0"+str(music_s)
info2 = str(music_m)+":"+str(music_s)
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))
...@@ -90,5 +114,9 @@ while True: ...@@ -90,5 +114,9 @@ while True:
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))
screen.blit(scoreSurf2, (170,440))
text2 = my_font.render(info,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