Commit 2edc1793 by BellCodeEditor

save project

parent 763da90b
Showing with 7 additions and 7 deletions
......@@ -24,7 +24,7 @@ volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0
play_button = stop_img
angle=0
angle=0 # 设置角度变量
while True:
for event in pygame.event.get():
......@@ -54,7 +54,7 @@ while True:
else:
play_button = play_img
pygame.mixer.music.pause()
if x > 420 and x < 520 and y > 350 and y < 400: # 下一曲
if x > 420 and x < 520 and y > 350 and y < 400:
num += 1
if num > len(music_list) - 1:
num = 0
......@@ -66,7 +66,7 @@ while True:
else:
click += 1
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
if num < 0:
num = len(music_list) - 1
......@@ -85,10 +85,10 @@ while True:
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
new_logo=pygame.transform.rotate(logo_img,angle)
newRect=new_logo.get_rect(center=(320,200))
pos=(newRect[0],newRect[1])
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]) # 将元组前两项赋值生成一对坐标
if play_button==stop_img: # 当图标为暂停时旋转
angle+=1
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
......
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