Commit e3525347 by BellCodeEditor

save project

parent 3e7ab052
Showing with 12 additions and 13 deletions
...@@ -66,16 +66,8 @@ while True: ...@@ -66,16 +66,8 @@ while True:
click += 2 click += 2
else: else:
click += 1 click += 1
pygame.mixer.Sound('C:\\Users\\Administrator\\Desktop\\存放处')
play_time= pygame.mixer.music.get_pos()
nb=play_time//1000
BN=nb//60
NB=nb%60
into=str(BN)+':'+str(NB)
scoreSurf=basic_font.render(into,True,(225,225,225))
print(into)
screen.blit(scoreSurf,(120,440))
print(play_time)
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
if num < 0: if num < 0:
...@@ -98,9 +90,9 @@ while True: ...@@ -98,9 +90,9 @@ while True:
NB=nb%60 NB=nb%60
into=str(BN)+':'+str(NB) into=str(BN)+':'+str(NB)
scoreSurf=basic_font.render(into,True,(225,225,225)) scoreSurf=basic_font.render(into,True,(225,225,225))
print(into)
screen.blit(scoreSurf,(120,440)) screen.blit(scoreSurf,(120,440))
print(play_time)
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
...@@ -109,13 +101,19 @@ while True: ...@@ -109,13 +101,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()
music1=pygame.mixer.Sound(path+'\\'+music_list[num])
music_length=music1.get_length()
music_length=int(music_length)
sbb=basic_font.render(into,True,(225,225,225))
# 绘制画面 # 绘制画面
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, newRect) # 中间logo图 screen.blit(logo, newRect) # 中间logo图
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(scoreSurf,(120,440))
screen.blit(sbb,(150,440))# 下一曲
# 刷新画面 # 刷新画面
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