Commit 7d92413f by BellCodeEditor

save project

parent 6b59bb51
Showing with 22 additions and 0 deletions
...@@ -25,6 +25,9 @@ pygame.mixer.music.set_volume(volume) ...@@ -25,6 +25,9 @@ pygame.mixer.music.set_volume(volume)
click = 0 click = 0
play_button = stop_img play_button = stop_img
angle = 0 angle = 0
music2 = pygame.mixer.Sound(path + "\\" + music_list[num])
cd = music2.get_length()
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -64,6 +67,9 @@ while True: ...@@ -64,6 +67,9 @@ while True:
click += 2 click += 2
else: else:
click += 1 click += 1
music2 = pygame.mixer.Sound(path + "\\" + music_list[num])
cd = music2.get_length()
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 +82,9 @@ while True: ...@@ -76,6 +82,9 @@ while True:
click += 2 click += 2
else: else:
click += 1 click += 1
music2 = pygame.mixer.Sound(path + "\\" + music_list[num])
cd = music2.get_length()
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
num += 1 num += 1
...@@ -83,6 +92,19 @@ while True: ...@@ -83,6 +92,19 @@ 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()
music2 = pygame.mixer.Sound(path + "\\" + music_list[num])
cd = music2.get_length()
cd = int(cd/1000)
fen2 = cd//60
miao2 = cd%60
play_time = pygame.mixer_music.get_pos()
play_time = int(play_time/1000)
fen = play_time//60
miao = play_time%60
print(str(fen) + ":" + str(miao) + "/" + str(fen2)+":" +str(miao2))
new_logo = pygame.transform.rotate(logo_img, angle) new_logo = pygame.transform.rotate(logo_img, angle)
if click % 2 == 0: if click % 2 == 0:
angle += 1 angle += 1
......
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