Commit b0f4a673 by BellCodeEditor

save project

parent f81c3dfe
Showing with 21 additions and 5 deletions
......@@ -3,7 +3,7 @@ from pygame import locals
import os
pygame.init()
font = pygame.font.Font("neuropol.ttf",30)
screen = pygame.display.set_mode((640, 480))
bg_img = pygame.image.load('background.png') # 背景图
......@@ -61,6 +61,9 @@ while True:
num = 0
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
music1 = pygame.mixer.Sound(path + "\\" + music_list[num])
cd = int( music1.get_length() )
play_button = stop_img
if click % 2 == 0:
click += 2
......@@ -73,6 +76,9 @@ while True:
num = len(music_list) - 1
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
music1 = pygame.mixer.Sound(path + "\\" + music_list[num])
cd = int( music1.get_length() )
play_button = stop_img
if click % 2 == 0:
click += 2
......@@ -86,13 +92,20 @@ while True:
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
music1 = pygame.mixer.Sound(path + "\\" + music_list[num])
cd = int( music1.get_length() )
playtime = pygame.mixer.music.get_pos()
playtime = int( playtime / 1000 )
fen = playtime//60
miao = playtime % 60
info = str(fen) + ":" + str(miao)
print(info)
info1 = str(fen) + ":" + str(miao)
fen2 = cd//60
miao2 = cd % 60
info2 = str(fen2) + ":" + str(miao2)
info = info1 + "/" + info2
new_logo = pygame.transform.rotate(logo_img, angle)
newRect = new_logo.get_rect(center=(320,200))
if click%2 == 0:
......@@ -103,6 +116,8 @@ while True:
screen.blit(play_button, (270, 330))
screen.blit(new_logo,newRect)
screen.blit(last_img, (120, 350))
screen.blit(next_img, (420, 350))
screen.blit(next_img, (420, 350))
nr = font.render(info, True,(0,0,0))
screen.blit(nr,(120,440))
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