Commit b2f7194e by BellCodeEditor

save project

parent 2f32f4bc
Showing with 10 additions and 9 deletions
...@@ -12,6 +12,7 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮 ...@@ -12,6 +12,7 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮 last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮 next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮 logo_img = pygame.image.load('logo.png') # 下一曲按钮
font=pygame.font.Font('neuropol.ttf',25)
music_list = ["歌曲1.wav","歌曲2.wav","歌曲3.wav","歌曲4.ogg"] music_list = ["歌曲1.wav","歌曲2.wav","歌曲3.wav","歌曲4.ogg"]
...@@ -85,22 +86,21 @@ while True: ...@@ -85,22 +86,21 @@ while True:
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮 screen.blit(play_button, (270, 330)) # 暂停按钮
#if play_button == stop_img:
# new_logo=pygame.transform.rotate(logo_img,angle)
# newRect=new_logo.get_rect(center=(320,200))
# pos=(newRect[0],newRect[1])
# angle+=1
# screen.blit(new_logo, pos) # 中间logo图
new_logo=pygame.transform.rotate(logo_img,angle) new_logo=pygame.transform.rotate(logo_img,angle)
newRect=new_logo.get_rect(center=(320,200)) newRect=new_logo.get_rect(center=(320,200))
pos=(newRect[0],newRect[1]) pos=(newRect[0],newRect[1])
if play_button == stop_img: if play_button == stop_img:
angle+=1 angle+=1 # 中间logo图
screen.blit(new_logo, pos) screen.blit(new_logo, pos)
screen.blit(last_img, (120, 350)) # 上一曲 screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲 screen.blit(next_img, (420, 350)) # 下一曲
play_s=pygame.mixer.music.get_pos()
time=play_s//1000
mtime = time//60
stime = time%60
score=font.render(str(mtime)+":"+str(stime),True,(0,0,0))
screen.blit(score,(120,400))
# 刷新画面 # 刷新画面
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