Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

Administrator / pygame_lesson6_diy4

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit d7d47b9e authored 2 years ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent 5f5b5c1e
Hide whitespace changes
Inline Side-by-side
Showing with 21 additions and 5 deletions
  • my_music.py
my_music.py
View file @ d7d47b9e
......@@ -12,7 +12,6 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮
music_list = []
path = "C:\\Users\\Administrator\\Desktop"
filelist = os.listdir(path)
......@@ -76,10 +75,23 @@ while True:
click += 2
else:
click += 1
if pygame.mixer.music.get_busy() == False:
num += 1
if num > len(music_list)-1:
num = 0
if pygame.mixer.music.get_busy() == False:
num += 1
if num > len(music_list)-1:
num = 0
pygame.mixer.music.load(path+"\\"+music_list[num])
pygame.mixer.music.play()
music1=pygame.mixer.Soud(path+"\\"+music_list[num])
music_length=music1.get_lengt()
music_length=int(play_m)
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,jiaodu)
newRect=new_logo.get_rect(center=(200,90))
......@@ -92,5 +104,8 @@ while True:
screen.blit(logo_img, (170, 60)) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
#绘制时间长度
scoreSurf=basic_font.render(info,True)
# 刷新画面
pygame.display.update()
\ No newline at end of file
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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