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 363303f3 authored 3 years ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent b39f9378
Show whitespace changes
Inline Side-by-side
Showing with 18 additions and 3 deletions
  • my_music.py
my_music.py
View file @ 363303f3
......@@ -54,8 +54,8 @@ while True:
play_button = stop_img
pygame.mixer.music.unpause()
else:
play_button = play_img
pygame.mixer.music.pause()
play_button = play_img
if x > 420 and x < 520 and y > 350 and y < 400: # 下一曲
num += 1
if num > len(music_list) - 1:
......@@ -67,7 +67,9 @@ while True:
click += 2
else:
click += 1
music1=pygame.mixer.sound(path+"\\" + music_list[num])
music_lenght=music1.get_lenght()
music_lenght=int(music_lenght)
if x > 120 and x < 220 and y > 350 and y < 400: # 上一曲
num -= 1
if num < 0:
......@@ -90,7 +92,15 @@ while True:
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)
music_m=music_lenght//60
music_s=music_lenght%60
if music_s<10:
music_s="0"+str(music_s)
info=str(play_m)+":"+str(play_s)
#+++++
#+++++
new_logo=pygame.transform.rotate(logo_img,angle)
......@@ -98,7 +108,7 @@ while True:
newRect=new_logo=get_rect(center=(320,200))
#+++++
pos=(newRect[0],new_rect[1])
angle=1
angle+=1
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
......@@ -106,5 +116,9 @@ 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,Ture,(255,255,255))
screen.blit(scoreSurf,(120,440))
scoreSurf2=basic_font.render("/"+info2,Ture,(0,0,0))
screen.blit(scoreSurf2,(170,440))
# 刷新画面
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